summaryrefslogtreecommitdiffstats
path: root/bin/ls/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ls/print.c')
-rw-r--r--bin/ls/print.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c
index 982d079..26b35d7 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.13 1997/08/07 15:33:48 steve Exp $";
+ "$Id: print.c,v 1.14 1997/08/07 22:28:24 steve Exp $";
#endif
#endif /* not lint */
@@ -127,7 +127,8 @@ printlong(dp)
printtime(sp->st_ctime);
else
printtime(sp->st_mtime);
- (void)printf("%s", p->fts_name);
+ if (f_octal) (void)prn_octal(p->fts_name);
+ else (void)printf("%s", p->fts_name);
if (f_type)
(void)printtype(sp->st_mode);
if (S_ISLNK(sp->st_mode))
@@ -222,7 +223,7 @@ printaname(p, inodefield, sizefield)
if (f_size)
chcnt += printf("%*qd ",
(int)sizefield, howmany(sp->st_blocks, blocksize));
- chcnt += printf("%s", p->fts_name);
+ chcnt += f_octal ? prn_octal(p->fts_name) : printf("%s", p->fts_name);
if (f_type)
chcnt += printtype(sp->st_mode);
return (chcnt);
@@ -303,5 +304,9 @@ printlink(p)
return;
}
path[lnklen] = '\0';
- (void)printf(" -> %s", path);
+ if (f_octal) {
+ (void)printf(" -> ");
+ (void)prn_octal(path);
+ }
+ else (void)printf(" -> %s", path);
}
OpenPOWER on IntegriCloud