]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Change this to use positive flags, not negative.
authorTim Kientzle <kientzle@gmail.com>
Tue, 2 Feb 2010 07:29:22 +0000 (02:29 -0500)
committerTim Kientzle <kientzle@gmail.com>
Tue, 2 Feb 2010 07:29:22 +0000 (02:29 -0500)
Idioms like "if (!disabled)" are really hard to read.

SVN-Revision: 1853

tar/bsdtar.c
tar/bsdtar.h

index caa9e97636d52246f57e9ee945a6db222a3b5da0..fd164c76e7a7c755f39cc887945755300b9274f1 100644 (file)
@@ -228,9 +228,14 @@ main(int argc, char **argv)
        }
 #endif
 
+       /*
+        * Enable Mac OS "copyfile()" extension by default.
+        * This has no effect on other platforms.
+        */
+       bsdtar->enable_copyfile = 1;
 #ifdef COPYFILE_DISABLE_VAR
        if (getenv(COPYFILE_DISABLE_VAR))
-               bsdtar->disable_copyfile = 1;
+               bsdtar->enable_copyfile = 0;
 #endif
 
        bsdtar->argv = argv;
@@ -267,7 +272,7 @@ main(int argc, char **argv)
                        bsdtar->option_chroot = 1;
                        break;
                case OPTION_DISABLE_COPYFILE: /* Mac OS X */
-                       bsdtar->disable_copyfile = 1;
+                       bsdtar->enable_copyfile = 0;
                        break;
                case OPTION_EXCLUDE: /* GNU tar */
                        if (lafe_exclude(&bsdtar->matching, bsdtar->optarg))
@@ -346,7 +351,7 @@ main(int argc, char **argv)
                        /* GNU tar 1.13  used -l for --one-file-system */
                        bsdtar->option_warn_links = 1;
                        break;
-               case OPTION_LZMA:
+               case OPTION_LZMA: /* GNU tar beginning with 1.20 */
                        if (bsdtar->create_compression != '\0')
                                lafe_errc(1, 0,
                                    "Can't specify both -%c and -%c", opt,
index a9dbd758f3bc449c7ef8c2b3885b1370929e2030..a747c786556f221c52e8598b7d7c15e0c57f9d08 100644 (file)
@@ -74,7 +74,7 @@ struct bsdtar {
        char              option_unlink_first; /* -U */
        char              option_warn_links; /* --check-links */
        char              day_first; /* show day before month in -tv output */
-       char              disable_copyfile; /* For Mac OS */
+       char              enable_copyfile; /* For Mac OS */
 
        /* If >= 0, then close this when done. */
        int               fd;