diff options
author | Jason King <jason@ansipunx.net> | 2009-05-21 13:35:55 -0700 |
---|---|---|
committer | Jason King <jason@ansipunx.net> | 2009-05-21 13:35:55 -0700 |
commit | f7387fb09b8eecf790b90ea27d4beaf186ce6597 (patch) | |
tree | 0ee36787d160ff89ffb7963c6bac2a255ca6d3b1 | |
parent | 777badbabf97ea50949b9e46951163ea9fdd10e8 (diff) | |
download | illumos-gate-f7387fb09b8eecf790b90ea27d4beaf186ce6597.tar.gz |
6843432 ls color configuration ignores last rule
-rw-r--r-- | usr/src/cmd/ls/ls.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/cmd/ls/ls.c b/usr/src/cmd/ls/ls.c index 6b3bbd7d72..3777cfbdfa 100644 --- a/usr/src/cmd/ls/ls.c +++ b/usr/src/cmd/ls/ls.c @@ -3058,7 +3058,11 @@ ls_color_init() if ((colorstr = getenv("LS_COLORS")) == NULL) colorstr = default_colorstr; - color_sz = 0; + /* + * Determine the size of lsc_colors. color_sz can be > lsc_ncolors + * if there are invalid entries passed in the string (they are ignored) + */ + color_sz = 1; for (p = strchr(colorstr, ':'); p != NULL && *p != '\0'; p = strchr(++p, ':')) ++color_sz; |