OSDN Git Service

Merge pull request #11 from yoheie/fix_path_compare
[lha/lha.git] / src / lhext.c
index ad6ec1b..cf40998 100644 (file)
@@ -30,7 +30,7 @@ static void add_dirinfo(char* name, LzHeader* hdr);
 static void adjust_dirinfo();
 
 #ifdef HAVE_LIBAPPLEFILE
-static boolean decode_macbinary(FILE *ofp, size_t size, const char *outPath);
+static boolean decode_macbinary(FILE *ofp, off_t size, const char *outPath);
 #endif
 
 /* ------------------------------------------------------------------------ */
@@ -430,13 +430,11 @@ extract_one(afp, hdr)
                 }
             }
 
-            if (skip_flg == TRUE) { /* if skip_flg */
+            if (skip_flg == TRUE) {
                 if (stat(name, &stbuf) == 0 && force != TRUE) {
-                    if (stbuf.st_mtime >= hdr->unix_last_modified_stamp) {
-                        if (quiet != TRUE)
-                            printf("%s : Skipped...\n", name);
-                        return read_size;
-                    }
+                    if (quiet != TRUE)
+                        printf("%s : Skipped...\n", name);
+                    return read_size;
                 }
             }
             if (noexec) {
@@ -515,13 +513,13 @@ extract_one(afp, hdr)
                     if (up_flag == FALSE && force == FALSE) {
                         return read_size;
                     }
-                } else {
+                }
+
+                if (skip_flg == TRUE) {
                     if (GETSTAT(name, &stbuf) == 0 && force != TRUE) {
-                        if (stbuf.st_mtime >= hdr->unix_last_modified_stamp) {
-                            if (quiet != TRUE)
-                                printf("%s : Skipped...\n", name);
-                            return read_size;
-                        }
+                        if (quiet != TRUE)
+                            printf("%s : Skipped...\n", name);
+                        return read_size;
                     }
                 }
 
@@ -752,7 +750,7 @@ decode_macbinary(ofp, size, outPath)
     af_file_t *afp = NULL;
     FILE *ifp = NULL;
     unsigned char *datap;
-    off_t dlen;
+    size_t dlen;
 
     if ((afp = af_open(temporary_name)) != NULL) {
         /* fetch datafork */