OSDN Git Service

* src/lhext.c (extract_one): force extract when `f' option is
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sat, 24 Aug 2002 09:22:45 +0000 (09:22 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sat, 24 Aug 2002 09:22:45 +0000 (09:22 +0000)
specified. this is for OS-9 archives, [provisional].

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

src/lhext.c

index 11c7500..f98abb1 100644 (file)
@@ -247,6 +247,7 @@ extract_one(afp, hdr)
 
        if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) == UNIX_FILE_REGULAR
                && method != LZHDIRS_METHOD_NUM) {
+    extract_regular:
 #if 0
                for (method = 0;; method++) {
                        if (methods[method] == NULL) {
@@ -408,7 +409,10 @@ extract_one(afp, hdr)
                }
        }
        else {
-               error("Unknown information: \"%s\"", name);
+        if (force)              /* force extract */
+            goto extract_regular;
+        else
+            error("Unknown file type: \"%s\". use `f' option to force extract.", name);
        }
 
        if (!output_to_stdout)