summaryrefslogtreecommitdiffstats
path: root/bin/ls/print.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1998-04-24 07:49:51 +0000
committerdes <des@FreeBSD.org>1998-04-24 07:49:51 +0000
commitaedfea1af81dbce4903bc916468988620f4c150d (patch)
treeb2bd496713c9a27a50dd965ab7f20a1744c0ebf7 /bin/ls/print.c
parentabb0f6fda9e4fd0855dbe32688b31270fcbf0099 (diff)
downloadFreeBSD-src-aedfea1af81dbce4903bc916468988620f4c150d.zip
FreeBSD-src-aedfea1af81dbce4903bc916468988620f4c150d.tar.gz
o Renamed '-b' (show unprintables in octal) to '-B'
o Added a new '-b' which behaves as in AT&T Unices (show unprintables in octal, using C escape codes when possible) o Added '?' to the getopt() string, since the code in the switch considers it as a valid option.
Diffstat (limited to 'bin/ls/print.c')
-rw-r--r--bin/ls/print.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 26b35d7..84e0fe9 100644
--- a/bin/ls/print.c
+++ b/bin/ls/print.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94";
#else
static const char rcsid[] =
- "$Id: print.c,v 1.14 1997/08/07 22:28:24 steve Exp $";
+ "$Id: print.c,v 1.15 1998/04/21 22:02:01 des Exp $";
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ printlong(dp)
printtime(sp->st_ctime);
else
printtime(sp->st_mtime);
- if (f_octal) (void)prn_octal(p->fts_name);
+ if (f_octal || f_octal_escape) (void)prn_octal(p->fts_name);
else (void)printf("%s", p->fts_name);
if (f_type)
(void)printtype(sp->st_mode);
@@ -223,7 +223,8 @@ printaname(p, inodefield, sizefield)
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
- chcnt += f_octal ? prn_octal(p->fts_name) : printf("%s", p->fts_name);
+ chcnt += (f_octal || f_octal_escape) ? prn_octal(p->fts_name)
+ : printf("%s", p->fts_name);
if (f_type)
chcnt += printtype(sp->st_mode);
return (chcnt);
@@ -304,9 +305,9 @@ printlink(p)
return;
}
path[lnklen] = '\0';
- if (f_octal) {
- (void)printf(" -> ");
- (void)prn_octal(path);
+ if (f_octal || f_octal_escape) {
+ (void)printf(" -> ");
+ (void)prn_octal(path);
}
else (void)printf(" -> %s", path);
}
OpenPOWER on IntegriCloud