diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-07-17 18:19:50 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-07-17 18:19:50 +0000 |
commit | 647859390a1ca0de0e2072a48c299a3d66ce72f5 (patch) | |
tree | 7b8e8a5027780f2652604d21c07eea629ba86ff9 /bin/pax/ar_subs.c | |
parent | 7e26066d80314ff2a9386178d7e2c5a12a868fb3 (diff) |
Add a safe_print() function that uses vis(3) if output is a tty.
Uses the vis C-style mode which is consistent with what GNU tar
does (though GNU tar does vis(3) regardless of whether output is a tty).
It may make sense to add a flag to force vis(3)ification like ls does
but I have not done that here as I'm reticent to add more flags.
Diffstat (limited to 'bin/pax/ar_subs.c')
-rw-r--r-- | bin/pax/ar_subs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c index 346a7141730..591af8ba333 100644 --- a/bin/pax/ar_subs.c +++ b/bin/pax/ar_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar_subs.c,v 1.15 2001/05/16 03:04:55 mickey Exp $ */ +/* $OpenBSD: ar_subs.c,v 1.16 2001/07/17 18:19:48 millert Exp $ */ /* $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: ar_subs.c,v 1.15 2001/05/16 03:04:55 mickey Exp $"; +static char rcsid[] = "$OpenBSD: ar_subs.c,v 1.16 2001/07/17 18:19:48 millert Exp $"; #endif #endif /* not lint */ @@ -286,7 +286,7 @@ extract() if (vflag > 1) ls_list(arcn, now, listf); else { - (void)fputs(arcn->name, listf); + (void)safe_print(arcn->name, listf); vfpart = 1; } } @@ -490,7 +490,7 @@ wr_archive(arcn, is_app) if (vflag > 1) ls_list(arcn, now, listf); else { - (void)fputs(arcn->name, listf); + (void)safe_print(arcn->name, listf); vfpart = 1; } } @@ -906,7 +906,7 @@ copy() } if (vflag) { - (void)fputs(arcn->name, listf); + (void)safe_print(arcn->name, listf); vfpart = 1; } ++flcnt; |