From unknown Sat Aug 16 11:38:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19992: Small mistake in comment in source code of ls Resent-From: =?UTF-8?Q?Jaros=C5=82aw?= Gruca Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 03 Mar 2015 21:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19992 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 19992@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.142541937611074 (code B ref -1); Tue, 03 Mar 2015 21:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Mar 2015 21:49:36 +0000 Received: from localhost ([127.0.0.1]:34296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSuh5-0002sX-Cd for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:49:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39931) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSuZJ-0002gX-KB for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:41:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSuZD-0001zN-BM for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:41:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_40, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSuZD-0001zI-7t for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:41:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSuZC-0005zg-1n for bug-coreutils@gnu.org; Tue, 03 Mar 2015 16:41:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSuZ8-0001ye-SL for bug-coreutils@gnu.org; Tue, 03 Mar 2015 16:41:25 -0500 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:37246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSuZ8-0001yS-Kv for bug-coreutils@gnu.org; Tue, 03 Mar 2015 16:41:22 -0500 Received: by lbvn10 with SMTP id n10so40135681lbv.4 for ; Tue, 03 Mar 2015 13:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:message-id:mime-version:content-type :content-transfer-encoding; bh=LVure0ZSsYrUmq2OcH+WwjGJV6TqYHYqQxorREYq1FU=; b=qGWEzIyH06DOOGyrUD6tJ6TATCDN9RKM/tn02Ln+uRKh/WBL/mnPXyp1UVPVUmlLLW j2+xwK9SQDEUrWzMkypv6GRAMcq1CKHCrV75dvDecqPiWfWAZReTKRfdWDRyu8WH/UQW TZw2ft5saasqB8EVPol/qWEDsdwf/zogOHOVknDcCTWzQSQxEli6XOkH2B6q2ZSk2Y2l kYlqVgiCFUW9PYlPhSSh025VgLhhDlDzWV/PTjZdb1QItUAGGCNwEUMUbMr3A9ebGbLJ 6k4t/o0QRET/KIlsIEB5FyaSTUsykJ4eaY01564hAK1/6RN/GtrdTgqxFwU7vaiOWoW2 xoHw== X-Received: by 10.152.26.136 with SMTP id l8mr642728lag.109.1425418881211; Tue, 03 Mar 2015 13:41:21 -0800 (PST) Received: from [192.168.0.183] (user-164-127-217-170.play-internet.pl. [164.127.217.170]) by mx.google.com with ESMTPSA id jz4sm395430lbc.36.2015.03.03.13.41.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 13:41:20 -0800 (PST) Date: Tue, 03 Mar 2015 22:40:56 +0100 From: =?UTF-8?Q?Jaros=C5=82aw?= Gruca Message-Id: <1425418856.3385.0@smtp.gmail.com> X-Mailer: geary/0.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Mailman-Approved-At: Tue, 03 Mar 2015 16:49:34 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) 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 !=3D 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=3D'no=3Dx:rs=3Dy:...' # x,y =3D different SGR codes ls -l --color=3Dalways > foo -- Jaros=C5=82aw Gruca = From unknown Sat Aug 16 11:38:14 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?Jaros=C5=82aw?= Gruca Subject: bug#19992: closed (Re: bug#19992: Small mistake in comment in source code of ls) Message-ID: References: <54F6F8B4.6090707@draigBrady.com> <1425418856.3385.0@smtp.gmail.com> X-Gnu-PR-Message: they-closed 19992 X-Gnu-PR-Package: coreutils Reply-To: 19992@debbugs.gnu.org Date: Wed, 04 Mar 2015 12:22:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1425471722-29974-1" This is a multi-part message in MIME format... ------------=_1425471722-29974-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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@debbugs.gnu.org. --=20 19992: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19992 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1425471722-29974-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19992-done) by debbugs.gnu.org; 4 Mar 2015 12:21:19 +0000 Received: from localhost ([127.0.0.1]:34678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YT8Ig-0007mB-SM for submit@debbugs.gnu.org; Wed, 04 Mar 2015 07:21:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39097) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YT8Ie-0007lw-1g for 19992-done@debbugs.gnu.org; Wed, 04 Mar 2015 07:21:16 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t24CLB6S027840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 4 Mar 2015 07:21:11 -0500 Received: from localhost.localdomain (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t24CL80U026649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 4 Mar 2015 07:21:11 -0500 Message-ID: <54F6F8B4.6090707@draigBrady.com> Date: Wed, 04 Mar 2015 12:21:08 +0000 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: =?UTF-8?B?SmFyb3PFgmF3IEdydWNh?= , 19992-done@debbugs.gnu.org Subject: Re: bug#19992: Small mistake in comment in source code of ls References: <1425418856.3385.0@smtp.gmail.com> In-Reply-To: <1425418856.3385.0@smtp.gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19992-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.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. ------------=_1425471722-29974-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Mar 2015 21:49:36 +0000 Received: from localhost ([127.0.0.1]:34296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSuh5-0002sX-Cd for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:49:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39931) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSuZJ-0002gX-KB for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:41:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSuZD-0001zN-BM for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:41:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_40, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSuZD-0001zI-7t for submit@debbugs.gnu.org; Tue, 03 Mar 2015 16:41:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSuZC-0005zg-1n for bug-coreutils@gnu.org; Tue, 03 Mar 2015 16:41:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSuZ8-0001ye-SL for bug-coreutils@gnu.org; Tue, 03 Mar 2015 16:41:25 -0500 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]:37246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSuZ8-0001yS-Kv for bug-coreutils@gnu.org; Tue, 03 Mar 2015 16:41:22 -0500 Received: by lbvn10 with SMTP id n10so40135681lbv.4 for ; Tue, 03 Mar 2015 13:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:subject:to:message-id:mime-version:content-type :content-transfer-encoding; bh=LVure0ZSsYrUmq2OcH+WwjGJV6TqYHYqQxorREYq1FU=; b=qGWEzIyH06DOOGyrUD6tJ6TATCDN9RKM/tn02Ln+uRKh/WBL/mnPXyp1UVPVUmlLLW j2+xwK9SQDEUrWzMkypv6GRAMcq1CKHCrV75dvDecqPiWfWAZReTKRfdWDRyu8WH/UQW TZw2ft5saasqB8EVPol/qWEDsdwf/zogOHOVknDcCTWzQSQxEli6XOkH2B6q2ZSk2Y2l kYlqVgiCFUW9PYlPhSSh025VgLhhDlDzWV/PTjZdb1QItUAGGCNwEUMUbMr3A9ebGbLJ 6k4t/o0QRET/KIlsIEB5FyaSTUsykJ4eaY01564hAK1/6RN/GtrdTgqxFwU7vaiOWoW2 xoHw== X-Received: by 10.152.26.136 with SMTP id l8mr642728lag.109.1425418881211; Tue, 03 Mar 2015 13:41:21 -0800 (PST) Received: from [192.168.0.183] (user-164-127-217-170.play-internet.pl. [164.127.217.170]) by mx.google.com with ESMTPSA id jz4sm395430lbc.36.2015.03.03.13.41.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 13:41:20 -0800 (PST) Date: Tue, 03 Mar 2015 22:40:56 +0100 From: =?iso-8859-2?q?Jaros=B3aw?= Gruca Subject: Small mistake in comment in source code of ls To: bug-coreutils@gnu.org Message-Id: <1425418856.3385.0@smtp.gmail.com> X-Mailer: geary/0.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 03 Mar 2015 16:49:34 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) 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 !=3D 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=3D'no=3Dx:rs=3Dy:...' # x,y =3D different SGR codes ls -l --color=3Dalways > foo -- Jaros=C5=82aw Gruca = ------------=_1425471722-29974-1--