From: Tim Kientzle Date: Tue, 2 Feb 2010 07:29:22 +0000 (-0500) Subject: Change this to use positive flags, not negative. X-Git-Tag: v3.0.0a~1295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f457cd177d53deb05911360728cf5a0fd6486377;p=thirdparty%2Flibarchive.git Change this to use positive flags, not negative. Idioms like "if (!disabled)" are really hard to read. SVN-Revision: 1853 --- diff --git a/tar/bsdtar.c b/tar/bsdtar.c index caa9e9763..fd164c76e 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -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, diff --git a/tar/bsdtar.h b/tar/bsdtar.h index a9dbd758f..a747c7865 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -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;