emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#19992: closed (Small mistake in comment in source


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#19992: closed (Small mistake in comment in source code of ls)
Date: Wed, 04 Mar 2015 12:22:01 +0000

Your message dated Wed, 04 Mar 2015 12:21:08 +0000
with message-id <address@hidden>
and subject line Re: bug#19992: Small mistake in comment in source code of ls
has caused the debbugs.gnu.org bug report #19992,
regarding Small mistake in comment in source code of ls
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
19992: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19992
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 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




--- End Message ---
--- Begin Message --- Subject: Re: bug#19992: Small mistake in comment in source code of ls Date: Wed, 04 Mar 2015 12:21:08 +0000 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]