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
a96c7569e1
commit
55302b1f5d
@ -45,6 +45,7 @@ int revstatcmp(const FTSENT *, const FTSENT *);
|
|||||||
|
|
||||||
void printcol(DISPLAY *);
|
void printcol(DISPLAY *);
|
||||||
void printlong(DISPLAY *);
|
void printlong(DISPLAY *);
|
||||||
|
int printname(const char *);
|
||||||
void printscol(DISPLAY *);
|
void printscol(DISPLAY *);
|
||||||
void printstream(DISPLAY *);
|
void printstream(DISPLAY *);
|
||||||
void usage(void);
|
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
|
* a separator. If multiple arguments, precede each
|
||||||
* directory with its name.
|
* directory with its name.
|
||||||
*/
|
*/
|
||||||
if (output)
|
if (output) {
|
||||||
(void)printf("\n%s:\n", p->fts_path);
|
putchar('\n');
|
||||||
else if (argc > 1) {
|
printname(p->fts_path);
|
||||||
(void)printf("%s:\n", p->fts_path);
|
puts(":");
|
||||||
|
} else if (argc > 1) {
|
||||||
|
printname(p->fts_path);
|
||||||
|
puts(":");
|
||||||
output = 1;
|
output = 1;
|
||||||
}
|
}
|
||||||
chp = fts_children(ftsp, ch_options);
|
chp = fts_children(ftsp, ch_options);
|
||||||
|
@ -141,7 +141,7 @@ printscol(DISPLAY *dp)
|
|||||||
/*
|
/*
|
||||||
* print name in current style
|
* print name in current style
|
||||||
*/
|
*/
|
||||||
static int
|
int
|
||||||
printname(const char *name)
|
printname(const char *name)
|
||||||
{
|
{
|
||||||
if (f_octal || f_octal_escape)
|
if (f_octal || f_octal_escape)
|
||||||
|
Loading…
Reference in New Issue
Block a user