From 3ddfde68978041476ed0d0768b42060d160b83b2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 20 Jul 2006 10:20:23 +0000 Subject: [PATCH] Fix a bug: ls --file-type worked like --indicator-style=slash, rather than like --indicator-style=file-type. (FILE_TYPE_INDICATOR_OPTION): New enum member. (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION, not to 'p'. (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION. --- src/ls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ls.c b/src/ls.c index cdb3118..ef0b902 100644 --- a/src/ls.c +++ b/src/ls.c @@ -737,6 +737,7 @@ enum GROUP_DIRECTORIES_FIRST_OPTION, HIDE_OPTION, INDICATOR_STYLE_OPTION, + FILE_TYPE_INDICATOR_OPTION, /* FIXME: --kilobytes is deprecated (but not -k); remove in late 2006 */ KILOBYTES_LONG_OPTION, @@ -770,7 +771,7 @@ static struct option const long_options[] = {"almost-all", no_argument, NULL, 'A'}, {"ignore-backups", no_argument, NULL, 'B'}, {"classify", no_argument, NULL, 'F'}, - {"file-type", no_argument, NULL, 'p'}, + {"file-type", no_argument, NULL, FILE_TYPE_INDICATOR_OPTION}, {"si", no_argument, NULL, SI_OPTION}, {"dereference-command-line", no_argument, NULL, 'H'}, {"dereference-command-line-symlink-to-dir", no_argument, NULL, @@ -1530,6 +1531,10 @@ decode_switches (int argc, char **argv) print_with_color = false; /* disable --color */ break; + case FILE_TYPE_INDICATOR_OPTION: /* --file-type */ + indicator_style = file_type; + break; + case 'g': format = long_format; print_owner = false; -- 2.7.4