summaryrefslogtreecommitdiffstats
path: root/bin/pax/options.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-06-13 17:51:14 +0000
committermillert <millert@openbsd.org>2003-06-13 17:51:14 +0000
commit9cd57097da1b7038c2c20bea78a6bf2044b4f27c (patch)
tree2bac968c9881b1c4ef5c0c00d4ff4866e8fb2387 /bin/pax/options.c
parent5 fxp versions (only way to find out of the HPNA versions work, is to put them in here) (diff)
downloadwireguard-openbsd-9cd57097da1b7038c2c20bea78a6bf2044b4f27c.tar.xz
wireguard-openbsd-9cd57097da1b7038c2c20bea78a6bf2044b4f27c.zip
Add a -0 flag to make pax use a NUL instead of a newline as the
pathname separator. Works in list mode as well as read/copy mode. Based on a patch from David Leonard; closes PR 3310
Diffstat (limited to 'bin/pax/options.c')
-rw-r--r--bin/pax/options.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c
index 2c7b636608e..2aaf3f74230 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.57 2003/06/02 23:32:08 millert Exp $ */
+/* $OpenBSD: options.c,v 1.58 2003/06/13 17:51:14 millert Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static const char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
-static const char rcsid[] = "$OpenBSD: options.c,v 1.57 2003/06/02 23:32:08 millert Exp $";
+static const char rcsid[] = "$OpenBSD: options.c,v 1.58 2003/06/13 17:51:14 millert Exp $";
#endif
#endif /* not lint */
@@ -194,7 +194,7 @@ pax_options(int argc, char **argv)
/*
* process option flags
*/
- while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ"))
+ while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLPT:U:XYZ0"))
!= -1) {
switch (c) {
case 'a':
@@ -505,6 +505,14 @@ pax_options(int argc, char **argv)
Zflag = 1;
flg |= CZF;
break;
+ case '0':
+ /*
+ * Use \0 as pathname terminator.
+ * (For use with the -print0 option of find(1).)
+ */
+ zeroflag = 1;
+ flg |= C0F;
+ break;
default:
pax_usage();
break;