diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-18 10:59:45 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-18 10:59:45 +0000 |
commit | 55302b1f5d86e33fb0341565cc9dac950baad6a6 (patch) | |
tree | 1f627d419a97d1e0f2f2f202a153c66fbe02f3f6 /bin/ls/ls.c | |
parent | a96c7569e15921fa023426e26e355d6841135eda (diff) | |
download | FreeBSD-src-55302b1f5d86e33fb0341565cc9dac950baad6a6.zip FreeBSD-src-55302b1f5d86e33fb0341565cc9dac950baad6a6.tar.gz |
Print non-printing characters in directory names, as well as file names,
as `?' or `\ooo', depending on whether the -b or -B flags were used.
PR: 43995
MFC after: 1 month
Diffstat (limited to 'bin/ls/ls.c')
-rw-r--r-- | bin/ls/ls.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c index be19f36..07ae826 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -470,10 +470,13 @@ traverse(int argc, char *argv[], int options) * a separator. If multiple arguments, precede each * directory with its name. */ - if (output) - (void)printf("\n%s:\n", p->fts_path); - else if (argc > 1) { - (void)printf("%s:\n", p->fts_path); + if (output) { + putchar('\n'); + printname(p->fts_path); + puts(":"); + } else if (argc > 1) { + printname(p->fts_path); + puts(":"); output = 1; } chp = fts_children(ftsp, ch_options); |