diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-03-15 19:47:28 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-03-15 19:47:28 +0000 |
commit | 8148e79b802332afc1da2c302d8083d512ec112f (patch) | |
tree | e6ce0834701a2ed27baafcbcf77c9ecf1eaf50ac /bin | |
parent | fbffdb4e2453287944fbe873ad3f37cf12a51e7d (diff) |
Handle tar -o by setting the tar_nodir directly instead of faking up a
pax-like -o write_opt=nodir.
ok millert@ otto@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pax/extern.h | 3 | ||||
-rw-r--r-- | bin/pax/options.c | 6 | ||||
-rw-r--r-- | bin/pax/tar.c | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/bin/pax/extern.h b/bin/pax/extern.h index a90d7414122..3ceb90eef40 100644 --- a/bin/pax/extern.h +++ b/bin/pax/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.50 2015/03/09 04:23:29 guenther Exp $ */ +/* $OpenBSD: extern.h,v 1.51 2015/03/15 19:47:27 guenther Exp $ */ /* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */ /*- @@ -293,6 +293,7 @@ u_int st_hash(const char *, int, int); /* * tar.c */ +extern int tar_nodir; extern char *gnu_name_string, *gnu_link_string; int tar_endwr(void); off_t tar_endrd(void); diff --git a/bin/pax/options.c b/bin/pax/options.c index 664232f19fc..da10851c3fe 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.87 2015/03/12 04:15:03 guenther Exp $ */ +/* $OpenBSD: options.c,v 1.88 2015/03/15 19:47:27 guenther Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -722,6 +722,7 @@ tar_options(int argc, char **argv) break; case 'o': Oflag = 2; + tar_nodir = 1; break; case 'p': /* @@ -956,9 +957,6 @@ tar_options(int argc, char **argv) case APPND: frmt = &(fsub[Oflag ? F_OTAR : F_TAR]); - if (Oflag == 2 && opt_add("write_opt=nodir") < 0) - tar_usage(); - if (chdname != NULL) { /* initial chdir() */ if (ftree_add(chdname, 1) < 0) tar_usage(); diff --git a/bin/pax/tar.c b/bin/pax/tar.c index 2a483c8c3a0..7878e2593e7 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tar.c,v 1.56 2015/03/09 04:23:29 guenther Exp $ */ +/* $OpenBSD: tar.c,v 1.57 2015/03/15 19:47:27 guenther Exp $ */ /* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */ /*- @@ -70,7 +70,7 @@ static gid_t gid_warn; * Routines common to all versions of tar */ -static int tar_nodir; /* do not write dirs under old tar */ +int tar_nodir; /* do not write dirs under old tar */ char *gnu_name_string; /* GNU ././@LongLink hackery name */ char *gnu_link_string; /* GNU ././@LongLink hackery link */ |