From unknown Sun Jun 22 07:53:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34285: grep.c should #include Resent-From: DAVID MONNIAUX Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Sat, 02 Feb 2019 09:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34285 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 34285@debbugs.gnu.org X-Debbugs-Original-To: bug-grep@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1549098556362 (code B ref -1); Sat, 02 Feb 2019 09:10:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Feb 2019 09:09:16 +0000 Received: from localhost ([127.0.0.1]:55453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gprIZ-00005m-Ox for submit@debbugs.gnu.org; Sat, 02 Feb 2019 04:09:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gprIW-00005W-Sp for submit@debbugs.gnu.org; Sat, 02 Feb 2019 04:09:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:54119) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gprIR-0001C8-OS for submit@debbugs.gnu.org; Sat, 02 Feb 2019 04:09:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gprIQ-0007iZ-Bp for bug-grep@gnu.org; Sat, 02 Feb 2019 04:09:07 -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.8 required=5.0 tests=BAYES_50,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gprIP-00018z-G4 for bug-grep@gnu.org; Sat, 02 Feb 2019 04:09:06 -0500 Received: from zm-mta-out-1.u-ga.fr ([152.77.200.56]:52440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gprIO-00010E-Pn for bug-grep@gnu.org; Sat, 02 Feb 2019 04:09:05 -0500 Received: from zm-mta-out.u-ga.fr (zm-mta-out.u-ga.fr [152.77.200.58]) by zm-mta-out-1.u-ga.fr (Postfix) with ESMTP id 1BD1DA02BF for ; Sat, 2 Feb 2019 10:08:55 +0100 (CET) Received: from zm-mbx6.u-ga.fr (zm-mbx6.u-ga.fr [152.77.200.8]) by zm-mta-out.u-ga.fr (Postfix) with ESMTP id 187A0E00AD for ; Sat, 2 Feb 2019 10:08:55 +0100 (CET) Date: Sat, 2 Feb 2019 10:08:55 +0100 (CET) From: DAVID MONNIAUX Message-ID: <304767834.1537039.1549098535001.JavaMail.zimbra@univ-grenoble-alpes.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_ad899a78-17d6-475e-9d8d-6462c7a451a8" X-Originating-IP: [152.77.200.60] X-Mailer: Zimbra 8.7.11_GA_3706 (ZimbraWebClient - FF65 (Linux)/8.7.11_GA_3706) Thread-Index: zwAKEBInIt3v7PX1SD/k17h0WfQYoQ== Thread-Topic: grep.c should #include X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 152.77.200.56 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -0.3 (/) --=_ad899a78-17d6-475e-9d8d-6462c7a451a8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable grep.c should #include because it uses strcasecmp, and POSIX sa= ys it is declared in =20 Not doing so results in a warning about an undeclared function on some syst= ems (including Kalray k1c), thus possibly in incorrect code being generated= .=20 Directeur de recherche au CNRS, laboratoire VERIMAG, =C3=A9quipe PACSS=20 http://www-verimag.imag.fr/~monniaux/=20 --=_ad899a78-17d6-475e-9d8d-6462c7a451a8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
grep.c should #include <strings.h> be= cause it uses strcasecmp, and POSIX says it is declared in <strings.h>= ;

Not doing so results in= a warning about an undeclared function on some systems (including Kalray k= 1c), thus possibly in incorrect code being generated.


Directeur de recherche au CNRS, laboratoire VERIMAG, =C3= =A9quipe PACSS
http://www-verimag.imag.fr/~monniaux/
<= /html> --=_ad899a78-17d6-475e-9d8d-6462c7a451a8-- From unknown Sun Jun 22 07:53:58 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: DAVID MONNIAUX Subject: bug#34285: closed (Re: bug#34285: grep.c should #include ) Message-ID: References: <1ee9a30a-5ab3-7f66-2d1d-59fa43bd0c22@cs.ucla.edu> <304767834.1537039.1549098535001.JavaMail.zimbra@univ-grenoble-alpes.fr> X-Gnu-PR-Message: they-closed 34285 X-Gnu-PR-Package: grep Reply-To: 34285@debbugs.gnu.org Date: Sun, 03 Feb 2019 06:49:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1549176542-23088-1" This is a multi-part message in MIME format... ------------=_1549176542-23088-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #34285: grep.c should #include which was filed against the grep package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 34285@debbugs.gnu.org. --=20 34285: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D34285 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1549176542-23088-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 34285-done) by debbugs.gnu.org; 3 Feb 2019 06:48:56 +0000 Received: from localhost ([127.0.0.1]:56732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqBaK-000607-9B for submit@debbugs.gnu.org; Sun, 03 Feb 2019 01:48:56 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqBaJ-0005zr-8F for 34285-done@debbugs.gnu.org; Sun, 03 Feb 2019 01:48:55 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 419BA1611D2; Sat, 2 Feb 2019 22:48:49 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id rEvkjhDX5Uv9; Sat, 2 Feb 2019 22:48:48 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6AC001611D5; Sat, 2 Feb 2019 22:48:48 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mOIM1v6tySiw; Sat, 2 Feb 2019 22:48:48 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 33366160992; Sat, 2 Feb 2019 22:48:48 -0800 (PST) Subject: Re: bug#34285: grep.c should #include To: DAVID MONNIAUX , 34285-done@debbugs.gnu.org References: <304767834.1537039.1549098535001.JavaMail.zimbra@univ-grenoble-alpes.fr> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <1ee9a30a-5ab3-7f66-2d1d-59fa43bd0c22@cs.ucla.edu> Date: Sat, 2 Feb 2019 22:48:47 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <304767834.1537039.1549098535001.JavaMail.zimbra@univ-grenoble-alpes.fr> Content-Type: multipart/mixed; boundary="------------C91D6A1B750DE4BC73A0FC9A" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 34285-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.3 (---) This is a multi-part message in MIME format. --------------C91D6A1B750DE4BC73A0FC9A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit DAVID MONNIAUX wrote: > grep.c should #include because it uses strcasecmp, and POSIX says it is declared in Thanks for reporting that. I fixed it as part of installing the attached patches. --------------C91D6A1B750DE4BC73A0FC9A Content-Type: text/x-patch; name="0001-build-update-gnulib-submodule-to-latest.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-build-update-gnulib-submodule-to-latest.patch" >From 5bb06952f630adae012d9be6a342a6def2774fff Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Feb 2019 22:42:49 -0800 Subject: [PATCH 1/2] build: update gnulib submodule to latest --- gnulib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnulib b/gnulib index 5b490ef..3043e43 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 5b490ef07f257a5dd41fc0b351c1a387b8a8f89c +Subproject commit 3043e43a7c30516482725c69b36f8feb4846f819 -- 2.17.1 --------------C91D6A1B750DE4BC73A0FC9A Content-Type: text/x-patch; name="0002-grep-fix-grep.c-includes.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-grep-fix-grep.c-includes.patch" >From f9400e622c46c122c703a9d5f5f6c95c3192014d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Feb 2019 22:46:52 -0800 Subject: [PATCH 2/2] grep: fix grep.c includes * src/grep.c: Include strings.h; problem reported by David Monniaux (Bug#34285). Do not include fcntl.h, as system.h does that for us.h --- src/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grep.c b/src/grep.c index e53b8cd..fcc07b8 100644 --- a/src/grep.c +++ b/src/grep.c @@ -22,10 +22,10 @@ #include #include #include -#include #include #include #include +#include #include "system.h" #include "argmatch.h" -- 2.17.1 --------------C91D6A1B750DE4BC73A0FC9A-- ------------=_1549176542-23088-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Feb 2019 09:09:16 +0000 Received: from localhost ([127.0.0.1]:55453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gprIZ-00005m-Ox for submit@debbugs.gnu.org; Sat, 02 Feb 2019 04:09:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gprIW-00005W-Sp for submit@debbugs.gnu.org; Sat, 02 Feb 2019 04:09:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:54119) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gprIR-0001C8-OS for submit@debbugs.gnu.org; Sat, 02 Feb 2019 04:09:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gprIQ-0007iZ-Bp for bug-grep@gnu.org; Sat, 02 Feb 2019 04:09:07 -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.8 required=5.0 tests=BAYES_50,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gprIP-00018z-G4 for bug-grep@gnu.org; Sat, 02 Feb 2019 04:09:06 -0500 Received: from zm-mta-out-1.u-ga.fr ([152.77.200.56]:52440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gprIO-00010E-Pn for bug-grep@gnu.org; Sat, 02 Feb 2019 04:09:05 -0500 Received: from zm-mta-out.u-ga.fr (zm-mta-out.u-ga.fr [152.77.200.58]) by zm-mta-out-1.u-ga.fr (Postfix) with ESMTP id 1BD1DA02BF for ; Sat, 2 Feb 2019 10:08:55 +0100 (CET) Received: from zm-mbx6.u-ga.fr (zm-mbx6.u-ga.fr [152.77.200.8]) by zm-mta-out.u-ga.fr (Postfix) with ESMTP id 187A0E00AD for ; Sat, 2 Feb 2019 10:08:55 +0100 (CET) Date: Sat, 2 Feb 2019 10:08:55 +0100 (CET) From: DAVID MONNIAUX To: bug-grep@gnu.org Message-ID: <304767834.1537039.1549098535001.JavaMail.zimbra@univ-grenoble-alpes.fr> Subject: grep.c should #include MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_ad899a78-17d6-475e-9d8d-6462c7a451a8" X-Originating-IP: [152.77.200.60] X-Mailer: Zimbra 8.7.11_GA_3706 (ZimbraWebClient - FF65 (Linux)/8.7.11_GA_3706) Thread-Index: zwAKEBInIt3v7PX1SD/k17h0WfQYoQ== Thread-Topic: grep.c should #include X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 152.77.200.56 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -0.3 (/) --=_ad899a78-17d6-475e-9d8d-6462c7a451a8 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable grep.c should #include because it uses strcasecmp, and POSIX sa= ys it is declared in =20 Not doing so results in a warning about an undeclared function on some syst= ems (including Kalray k1c), thus possibly in incorrect code being generated= .=20 Directeur de recherche au CNRS, laboratoire VERIMAG, =C3=A9quipe PACSS=20 http://www-verimag.imag.fr/~monniaux/=20 --=_ad899a78-17d6-475e-9d8d-6462c7a451a8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
grep.c should #include <strings.h> be= cause it uses strcasecmp, and POSIX says it is declared in <strings.h>= ;

Not doing so results in= a warning about an undeclared function on some systems (including Kalray k= 1c), thus possibly in incorrect code being generated.


Directeur de recherche au CNRS, laboratoire VERIMAG, =C3= =A9quipe PACSS
http://www-verimag.imag.fr/~monniaux/
<= /html> --=_ad899a78-17d6-475e-9d8d-6462c7a451a8-- ------------=_1549176542-23088-1-- From unknown Sun Jun 22 07:53:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34285: grep.c should #include Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Sun, 03 Feb 2019 19:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34285 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: DAVID MONNIAUX , 34285@debbugs.gnu.org Received: via spool by 34285-submit@debbugs.gnu.org id=B34285.154922344210325 (code B ref 34285); Sun, 03 Feb 2019 19:51:01 +0000 Received: (at 34285) by debbugs.gnu.org; 3 Feb 2019 19:50:42 +0000 Received: from localhost ([127.0.0.1]:57773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqNms-0002gS-0Z for submit@debbugs.gnu.org; Sun, 03 Feb 2019 14:50:42 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gqNmp-0002gE-FN for 34285@debbugs.gnu.org; Sun, 03 Feb 2019 14:50:40 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BF8B51611DE; Sun, 3 Feb 2019 11:50:32 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id CfaE6CG24juz; Sun, 3 Feb 2019 11:50:31 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DEBBD161207; Sun, 3 Feb 2019 11:50:31 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uBRJSZxN_3-h; Sun, 3 Feb 2019 11:50:31 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B4D87160992; Sun, 3 Feb 2019 11:50:31 -0800 (PST) From: Paul Eggert References: <304767834.1537039.1549098535001.JavaMail.zimbra@univ-grenoble-alpes.fr> <1ee9a30a-5ab3-7f66-2d1d-59fa43bd0c22@cs.ucla.edu> Organization: UCLA Computer Science Department Message-ID: <86efe442-7845-bece-ccb2-b4c1d97ff8ca@cs.ucla.edu> Date: Sun, 3 Feb 2019 11:50:31 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1ee9a30a-5ab3-7f66-2d1d-59fa43bd0c22@cs.ucla.edu> Content-Type: multipart/mixed; boundary="------------B039727EC0B97C9632CF029F" Content-Language: en-US X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.3 (---) This is a multi-part message in MIME format. --------------B039727EC0B97C9632CF029F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Paul Eggert wrote: > I fixed it as part of installing the attached patches. Come to think of it, grep shouldn't call strcasecmp here. It should call c_strcasecmp instead because the matching should be locale-independent. So I installed the attached further patch and there is no longer a need to include strings.h even on non-GNU platforms. --------------B039727EC0B97C9632CF029F Content-Type: text/x-patch; name="0001-grep-parse-color-arg-independent-of-locale.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-grep-parse-color-arg-independent-of-locale.patch" >From 65779292d28dd3e57de147dc27db0a125d99b5ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 3 Feb 2019 11:46:36 -0800 Subject: [PATCH] grep: parse --color arg independent of locale This is a better fix for Bug#34285. * bootstrap.conf (gnulib_modules): Add c-strcase. * src/grep.c: Include c-strcase.h, not strings.h. (main): Use c_strcasecmp, not strcasecmp. --- bootstrap.conf | 1 + src/grep.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index ea3eddf..d453b3e 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -28,6 +28,7 @@ announce-gen argmatch c-ctype c-stack +c-strcase closeout configmake dfa diff --git a/src/grep.c b/src/grep.c index fcc07b8..ef6abb8 100644 --- a/src/grep.c +++ b/src/grep.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "system.h" #include "argmatch.h" @@ -47,6 +46,7 @@ #include "quote.h" #include "safe-read.h" #include "search.h" +#include "c-strcase.h" #include "version-etc.h" #include "xalloc.h" #include "xbinary-io.h" @@ -2698,14 +2698,17 @@ main (int argc, char **argv) case COLOR_OPTION: if (optarg) { - if (!strcasecmp (optarg, "always") || !strcasecmp (optarg, "yes") - || !strcasecmp (optarg, "force")) + if (!c_strcasecmp (optarg, "always") + || !c_strcasecmp (optarg, "yes") + || !c_strcasecmp (optarg, "force")) color_option = 1; - else if (!strcasecmp (optarg, "never") || !strcasecmp (optarg, "no") - || !strcasecmp (optarg, "none")) + else if (!c_strcasecmp (optarg, "never") + || !c_strcasecmp (optarg, "no") + || !c_strcasecmp (optarg, "none")) color_option = 0; - else if (!strcasecmp (optarg, "auto") || !strcasecmp (optarg, "tty") - || !strcasecmp (optarg, "if-tty")) + else if (!c_strcasecmp (optarg, "auto") + || !c_strcasecmp (optarg, "tty") + || !c_strcasecmp (optarg, "if-tty")) color_option = 2; else show_help = 1; -- 2.17.1 --------------B039727EC0B97C9632CF029F--