GNU bug report logs -
#19992
Small mistake in comment in source code of ls
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#19992: Small mistake in comment in source code of ls
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 19992 <at> debbugs.gnu.org.
--
19992: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19992
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
On 03/03/15 21:40, Jarosław Gruca wrote:
> 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
Pushed at http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=69410690
thanks!
Pádraig.
[Message part 3 (message/rfc822, inline)]
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
This bug report was last modified 10 years and 136 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.