summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-05-01 05:19:34 +0000
committerJim Meyering <jim@meyering.net>1996-05-01 05:19:34 +0000
commit482d5be531dc28b4aee7f18324d02b5dc1a41a27 (patch)
treec94c8c6b9c300c737c8d20fd381ac5adbb51391a /src/ls.c
parent87afdbeb7d268365c01bdce990472b5a6cf37ec8 (diff)
downloadcoreutils-482d5be531dc28b4aee7f18324d02b5dc1a41a27.tar.xz
(parse_ls_color, usage): Remove support for alternate spellings:
--colours and LS_COLOURS.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ls.c b/src/ls.c
index f1be7112e..8afbbf798 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -522,7 +522,6 @@ static struct option const long_options[] =
{"help", no_argument, &show_help, 1},
{"version", no_argument, &show_version, 1},
{"color", optional_argument, 0, 13},
- {"colour", optional_argument, 0, 13},
{NULL, 0, NULL, 0}
};
@@ -1281,6 +1280,9 @@ get_funky_string (char **dest, const char **src, int equals_end)
else
state = ST_ERROR;
break;
+
+ default:
+ abort();
}
}
@@ -1294,7 +1296,6 @@ static void
parse_ls_color (void)
{
const char *p; /* Pointer to character being parsed */
- char *whichvar; /* LS_COLORS or LS_COLOURS? */
char *buf; /* color_buf buffer pointer */
int state; /* State of parser */
int ind_no; /* Indicator number */
@@ -1303,8 +1304,7 @@ parse_ls_color (void)
struct col_ext_type *ext2; /* Extra pointer */
strcpy (label, "??");
- if (((p = getenv (whichvar = "LS_COLORS")) != NULL && *p != '\0')
- || ((p = getenv (whichvar = "LS_COLOURS")) != NULL && *p != '\0'))
+ if (((p = getenv ("LS_COLORS")) != NULL && *p != '\0'))
{
buf = color_buf = xstrdup (p);
/* This is an overly conservative estimate, but any possible
@@ -1398,12 +1398,15 @@ parse_ls_color (void)
if (state < 0)
{
- error (0, 0, _("unparsable %s variable"), whichvar);
+ struct col_ext_type *e;
+
+ error (0, 0,
+ _("unparsable value for LS_COLORS environment variable"));
free (color_buf);
- for (ext = col_ext_list; ext != NULL ; )
+ for (e = col_ext_list; e != NULL ; /* empty */)
{
- ext2 = ext;
- ext = ext->next;
+ ext2 = e;
+ e = e->next;
free (ext2);
}
print_with_color = 0;
@@ -2682,7 +2685,7 @@ Sort entries alphabetically if none of -cftuSUX nor --sort.\n\
-C list entries by columns\n\
-c sort by change time; with -l: show ctime\n\
--color[=WORD] colorize entries according to WORD\n\
- --colour[=WORD] yes, no, or tty (if output is terminal)\n\
+ yes, no, or tty (if output is terminal)\n\
-D, --dired generate output well suited to Emacs' dired mode\n\
-d, --directory list directory entries instead of contents\n\
-F, --classify append a character for typing each entry\n\