OSDN Git Service

* src/header.c (get_header): the variable "noconvertcase" changed
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sat, 24 Feb 2007 14:35:57 +0000 (14:35 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sat, 24 Feb 2007 14:35:57 +0000 (14:35 +0000)
to "convertcase".
it means that this LHa does not convert filename case automatically.

* src/lha.h: ditto.

* src/lharc.c (init_variable): ditto.

* src/lharc.c (print_tiny_usage, parse_suboption): added a long
option "--convert-filename-case" that change to the old behavior.

* src/lharc.c (print_usage, parse_suboption): the "g" option has
no meaning when extracting.

* src/header.c (write_header): no upcase filename when the generic
archive creating.

git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@865 6a8cc165-1e22-0410-a132-eb4e3f353aba

ChangeLog
src/header.c
src/lha.h
src/lharc.c

index a59d189..e17efb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2007-02-24  Koji Arai  <arai@users.sourceforge.jp>
 
+       * src/header.c (get_header): the variable "noconvertcase" changed
+       to "convertcase".
+       it means that this LHa does not convert filename case automatically.
+
+       * src/lha.h: ditto.
+
+       * src/lharc.c (init_variable): ditto.
+
+       * src/lharc.c (print_tiny_usage, parse_suboption): added a long
+       option "--convert-filename-case" that change to the old behavior.
+
+       * src/lharc.c (print_usage, parse_suboption): the "g" option has
+       no meaning when extracting.
+
+       * src/header.c (write_header): no upcase filename when the generic
+       archive creating.
+
+2007-02-24  Koji Arai  <arai@users.sourceforge.jp>
+
        * configure.ac: updated version.
 
        * src/lharc.c (print_usage): updated.
index 9ba5613..e4c2d56 100644 (file)
@@ -1080,7 +1080,7 @@ get_header(fp, hdr)
     /* filename conversion */
     switch (hdr->extend_type) {
     case EXTEND_MSDOS:
-        filename_case = noconvertcase ? NONE : TO_LOWER;
+        filename_case = convertcase ? TO_LOWER : NONE;
         break;
     case EXTEND_HUMAN:
     case EXTEND_OS68K:
@@ -1098,7 +1098,7 @@ get_header(fp, hdr)
         break;
 
     default:
-        filename_case = noconvertcase ? NONE : TO_LOWER;
+        filename_case = convertcase ? TO_LOWER : NONE;
         break;
     }
 
@@ -1679,7 +1679,7 @@ write_header(fp, hdr)
     if (optional_system_kanji_code)
         system_kanji_code = optional_system_kanji_code;
 
-    if (generic_format)
+    if (generic_format && convertcase)
         filename_case = TO_UPPER;
 
     if (hdr->header_level == 0) {
index 00b3a9c..c990e29 100644 (file)
--- a/src/lha.h
+++ b/src/lha.h
@@ -348,7 +348,7 @@ EXTERN char     *reading_filename, *writing_filename;
 EXTERN int      archive_file_mode;
 EXTERN int      archive_file_gid;
 
-EXTERN int      noconvertcase; /* 2000.10.6 */
+EXTERN int      convertcase;    /* 2000.10.6 */
 
 /* slide.c */
 EXTERN int      unpackable;
index d1a328a..032b0a5 100644 (file)
@@ -93,7 +93,7 @@ init_variable()     /* Added N.Watazaki */
     exclude_files                           = NULL;
     verify_mode                             = FALSE;
 
-    noconvertcase                           = FALSE;
+    convertcase                             = FALSE;
 
     extract_directory = NULL;
     temporary_fd = -1;
@@ -127,6 +127,7 @@ usage: lha [-]<commands>[<options>] [-<options> ...] archive_file [file...]\n\
   long options: --system-kanji-code={euc,sjis,utf8,cap}\n\
                 --archive-kanji-code={euc,sjis,utf8,cap}\n\
                 --extract-broken-archive\n\
+                --convert-filename-case\n\
                 --help\n\
                 --version\n");
 #else
@@ -137,6 +138,7 @@ usage: lha [-]<commands>[<options>] [-<options> ...] archive_file [file...]\n\
   long options: --system-kanji-code={euc,sjis,utf8,cap}\n\
                 --archive-kanji-code={euc,sjis,utf8,cap}\n\
                 --extract-broken-archive\n\
+                --convert-filename-case\n\
                 --help\n\
                 --version\n");
 #endif
@@ -179,7 +181,6 @@ commands:                           options:\n\
  p   Print to STDOUT from archive    i  ignore directory path (x/e)\n\
  t   Test file CRC in archive        z  files not compress (a/u/c)\n\
                                      g  Generic format (for compatibility)\n\
-                                        or not convert case when extracting\n\
                                      0/1/2 header level (a/u/c)\n\
 ");
 #ifdef EUC
@@ -226,6 +227,7 @@ parse_suboption(int argc, char **argv)
         {"system-kanji-code", required_argument, 0, SYSTEM_KANJI_CODE_OPTION},
         {"archive-kanji-code", required_argument, 0, ARCHIVE_KANJI_CODE_OPTION},
         {"extract-broken-archive", no_argument, &extract_broken_archive, 1},
+        {"convert-filename-case", no_argument, &convertcase, TRUE},
         {0, 0, 0, 0}
     };
     int i;
@@ -310,7 +312,6 @@ parse_suboption(int argc, char **argv)
             break;
         case 'g':
             generic_format = TRUE;
-            noconvertcase = TRUE;
             header_level = 0;
             break;
         case 'd':