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
This commit is contained in:
parent
728b72c237
commit
1656f85050
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105390
@ -45,6 +45,7 @@ int revstatcmp(const FTSENT *, const FTSENT *);
|
||||
|
||||
void printcol(DISPLAY *);
|
||||
void printlong(DISPLAY *);
|
||||
int printname(const char *);
|
||||
void printscol(DISPLAY *);
|
||||
void printstream(DISPLAY *);
|
||||
void usage(void);
|
||||
|
11
bin/ls/ls.c
11
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);
|
||||
|
@ -141,7 +141,7 @@ printscol(DISPLAY *dp)
|
||||
/*
|
||||
* print name in current style
|
||||
*/
|
||||
static int
|
||||
int
|
||||
printname(const char *name)
|
||||
{
|
||||
if (f_octal || f_octal_escape)
|
||||
|
Loading…
Reference in New Issue
Block a user