[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19992: Small mistake in comment in source code of ls
From: |
Jarosław Gruca |
Subject: |
bug#19992: Small mistake in comment in source code of ls |
Date: |
Tue, 03 Mar 2015 22:40:56 +0100 |
In the source code of "ls" (file "src/ls.c"):
{ 0, NULL }, /* ec: End color (replaces lc+no+rc) */
there is a small mistake in the comment.
In the place of 'lc+no+rc' should be 'lc+rs+rc' ('rs' instead of 'no').
Each file is written as 'lc+colorcode+rc+filename+ec', but if
the 'ec' code is undefined, the sequence 'lc+rs+rc' (with 'rs'),
and not 'lc+no+rc' (with 'no'), is used:
static void
prep_non_filename_text (void)
{
if (color_indicator[C_END].string != NULL)
put_indicator (&color_indicator[C_END]);
else
{
put_indicator (&color_indicator[C_LEFT]);
put_indicator (&color_indicator[C_RESET]); <--- here
put_indicator (&color_indicator[C_RIGHT]);
}
}
To ensure, I did several test by changing 'no' and 'rs'
with different values and observing printed escape sequences:
LS_COLORS='no=x:rs=y:...' # x,y = different SGR codes
ls -l --color=always > foo
--
Jarosław Gruca
- bug#19992: Small mistake in comment in source code of ls,
Jarosław Gruca <=