aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-05-12 18:40:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-05-12 18:40:59 +0200
commit4ad95e6b0e64b89cc03cb4f9791fe0d4daa7affc (patch)
treee871c124d5dd9eb6ad4063abf0a69fd17d8bbb12 /coreutils
parent75e77deab11dc976d55197fcd6021030ed323e07 (diff)
downloadbusybox-w32-4ad95e6b0e64b89cc03cb4f9791fe0d4daa7affc.tar.gz
busybox-w32-4ad95e6b0e64b89cc03cb4f9791fe0d4daa7affc.tar.bz2
busybox-w32-4ad95e6b0e64b89cc03cb4f9791fe0d4daa7affc.zip
ls: fix -p help text, improve comments and define names
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 217321933..eb40724bf 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -51,14 +51,14 @@
51//usage: "\n -d List directory entries instead of contents" 51//usage: "\n -d List directory entries instead of contents"
52//usage: IF_FEATURE_LS_FOLLOWLINKS( 52//usage: IF_FEATURE_LS_FOLLOWLINKS(
53//usage: "\n -L Follow symlinks" 53//usage: "\n -L Follow symlinks"
54//usage: "\n -H Follow symlinks on command line only" 54//usage: "\n -H Follow symlinks on command line"
55//usage: ) 55//usage: )
56//usage: IF_FEATURE_LS_RECURSIVE( 56//usage: IF_FEATURE_LS_RECURSIVE(
57//usage: "\n -R Recurse" 57//usage: "\n -R Recurse"
58//usage: ) 58//usage: )
59//usage: IF_FEATURE_LS_FILETYPES( 59//usage: IF_FEATURE_LS_FILETYPES(
60//usage: "\n -p Append / to dir entries"
60//usage: "\n -F Append indicator (one of */=@|) to entries" 61//usage: "\n -F Append indicator (one of */=@|) to entries"
61//usage: "\n -p Append indicator (one of /=@|) to entries"
62//usage: ) 62//usage: )
63//usage: "\n -l Long listing format" 63//usage: "\n -l Long listing format"
64//usage: "\n -i List inode numbers" 64//usage: "\n -i List inode numbers"
@@ -137,9 +137,9 @@ LIST_SIZE = 1 << 7,
137LIST_DATE_TIME = 1 << 8, 137LIST_DATE_TIME = 1 << 8,
138LIST_FULLTIME = 1 << 9, 138LIST_FULLTIME = 1 << 9,
139LIST_SYMLINK = 1 << 10, 139LIST_SYMLINK = 1 << 10,
140LIST_FILETYPE = 1 << 11, 140LIST_FILETYPE = 1 << 11, /* show / suffix for dirs */
141LIST_EXEC = 1 << 12, 141LIST_CLASSIFY = 1 << 12, /* requires LIST_FILETYPE, also show *,|,@,= suffixes */
142LIST_MASK = (LIST_EXEC << 1) - 1, 142LIST_MASK = (LIST_CLASSIFY << 1) - 1,
143 143
144/* what files will be displayed */ 144/* what files will be displayed */
145DISP_DIRNAME = 1 << 13, /* 2 or more items? label directories */ 145DISP_DIRNAME = 1 << 13, /* 2 or more items? label directories */
@@ -288,7 +288,7 @@ static const uint32_t opt_flags[] = {
288 SORT_VERSION, /* v */ 288 SORT_VERSION, /* v */
289#endif 289#endif
290#if ENABLE_FEATURE_LS_FILETYPES 290#if ENABLE_FEATURE_LS_FILETYPES
291 LIST_FILETYPE | LIST_EXEC, /* F */ 291 LIST_FILETYPE | LIST_CLASSIFY, /* F */
292 LIST_FILETYPE, /* p */ 292 LIST_FILETYPE, /* p */
293#endif 293#endif
294#if ENABLE_FEATURE_LS_RECURSIVE 294#if ENABLE_FEATURE_LS_RECURSIVE
@@ -396,8 +396,8 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
396 * 3/7:multiplexed char/block device) 396 * 3/7:multiplexed char/block device)
397 * and we use 0 for unknown and 15 for executables (see below) */ 397 * and we use 0 for unknown and 15 for executables (see below) */
398#define TYPEINDEX(mode) (((mode) >> 12) & 0x0f) 398#define TYPEINDEX(mode) (((mode) >> 12) & 0x0f)
399#define TYPECHAR(mode) ("0pcCd?bB-?l?s???" [TYPEINDEX(mode)]) 399/* un fi chr - dir - blk - file - link - sock - - exe */
400#define APPCHAR(mode) ("\0|\0\0/\0\0\0\0\0@\0=\0\0\0" [TYPEINDEX(mode)]) 400#define APPCHAR(mode) ("\0""|""\0""\0""/""\0""\0""\0""\0""\0""@""\0""=""\0""\0""\0" [TYPEINDEX(mode)])
401/* 036 black foreground 050 black background 401/* 036 black foreground 050 black background
402 037 red foreground 051 red background 402 037 red foreground 051 red background
403 040 green foreground 052 green background 403 040 green foreground 052 green background
@@ -408,7 +408,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
408 045 gray foreground 057 white background 408 045 gray foreground 057 white background
409*/ 409*/
410#define COLOR(mode) ( \ 410#define COLOR(mode) ( \
411 /*un fi chr dir blk file link sock exe */ \ 411 /*un fi chr - dir - blk - file - link - sock - - exe */ \
412 "\037\043\043\045\042\045\043\043\000\045\044\045\043\045\045\040" \ 412 "\037\043\043\045\042\045\043\043\000\045\044\045\043\045\045\040" \
413 [TYPEINDEX(mode)]) 413 [TYPEINDEX(mode)])
414/* Select normal (0) [actually "reset all"] or bold (1) 414/* Select normal (0) [actually "reset all"] or bold (1)
@@ -417,7 +417,7 @@ static struct dnode *my_stat(const char *fullname, const char *name, int force_f
417 * Note: coreutils 6.9 uses inverted red for setuid binaries. 417 * Note: coreutils 6.9 uses inverted red for setuid binaries.
418 */ 418 */
419#define ATTR(mode) ( \ 419#define ATTR(mode) ( \
420 /*un fi chr dir blk file link sock exe */ \ 420 /*un fi chr - dir - blk - file- link- sock- - exe */ \
421 "\01\00\01\07\01\07\01\07\00\07\01\07\01\07\07\01" \ 421 "\01\00\01\07\01\07\01\07\00\07\01\07\01\07\07\01" \
422 [TYPEINDEX(mode)]) 422 [TYPEINDEX(mode)])
423 423
@@ -444,7 +444,7 @@ static char append_char(mode_t mode)
444 return '\0'; 444 return '\0';
445 if (S_ISDIR(mode)) 445 if (S_ISDIR(mode))
446 return '/'; 446 return '/';
447 if (!(all_fmt & LIST_EXEC)) 447 if (!(all_fmt & LIST_CLASSIFY))
448 return '\0'; 448 return '\0';
449 if (S_ISREG(mode) && (mode & (S_IXUSR | S_IXGRP | S_IXOTH))) 449 if (S_ISREG(mode) && (mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
450 return '*'; 450 return '*';