OSDN Git Service

Change skip behavior on extracting.
authorYohei Endo <yoheie@gmail.com>
Thu, 6 Oct 2016 13:20:44 +0000 (22:20 +0900)
committerYohei Endo <yoheie@gmail.com>
Thu, 6 Oct 2016 13:20:44 +0000 (22:20 +0900)
Change "Skip" to skip all files which will be overwritten.

src/lhext.c

index 648ced9..842b3e0 100644 (file)
@@ -432,11 +432,11 @@ extract_one(afp, hdr)
 
             if (skip_flg == TRUE) { /* if skip_flg */
                 if (stat(name, &stbuf) == 0 && force != TRUE) {
 
             if (skip_flg == TRUE) { /* if skip_flg */
                 if (stat(name, &stbuf) == 0 && force != TRUE) {
-                    if (stbuf.st_mtime >= hdr->unix_last_modified_stamp) {
+                    /* 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) {
                 }
             }
             if (noexec) {
@@ -515,13 +515,15 @@ extract_one(afp, hdr)
                     if (up_flag == FALSE && force == FALSE) {
                         return read_size;
                     }
                     if (up_flag == FALSE && force == FALSE) {
                         return read_size;
                     }
-                } else {
+                }
+
+                if (skip_flg == TRUE) { /* if skip_flg */
                     if (GETSTAT(name, &stbuf) == 0 && force != TRUE) {
                     if (GETSTAT(name, &stbuf) == 0 && force != TRUE) {
-                        if (stbuf.st_mtime >= hdr->unix_last_modified_stamp) {
+                        /* 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;
-                        }
+                        /* } */
                     }
                 }
 
                     }
                 }