GNU bug report logs - #19992
Small mistake in comment in source code of ls

Previous Next

Package: coreutils;

Reported by: Jarosław Gruca <jgruca1981 <at> gmail.com>

Date: Tue, 3 Mar 2015 21:50:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19992 in the body.
You can then email your comments to 19992 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#19992; Package coreutils. (Tue, 03 Mar 2015 21:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jarosław Gruca <jgruca1981 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 03 Mar 2015 21:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jarosław Gruca <jgruca1981 <at> gmail.com>
To: bug-coreutils <at> gnu.org
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





Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Wed, 04 Mar 2015 12:22:01 GMT) Full text and rfc822 format available.

Notification sent to Jarosław Gruca <jgruca1981 <at> gmail.com>:
bug acknowledged by developer. (Wed, 04 Mar 2015 12:22:02 GMT) Full text and rfc822 format available.

Message #10 received at 19992-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jarosław Gruca <jgruca1981 <at> gmail.com>,
 19992-done <at> debbugs.gnu.org
Subject: Re: bug#19992: Small mistake in comment in source code of ls
Date: Wed, 04 Mar 2015 12:21:08 +0000
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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 Apr 2015 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.