GNU bug report logs - #17056
dfa.c patch for systems with no locale support

Previous Next

Package: grep;

Reported by: Aharon Robbins <arnold <at> skeeve.com>

Date: Fri, 21 Mar 2014 11:42:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Aharon Robbins <arnold <at> skeeve.com>
Subject: bug#17056: closed (Re: bug#17056: dfa.c patch for systems with no
 locale support)
Date: Sun, 23 Mar 2014 21:17:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#17056: dfa.c patch for systems with no locale support

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 17056 <at> debbugs.gnu.org.

-- 
17056: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17056
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Aharon Robbins <arnold <at> skeeve.com>, 17056-done <at> debbugs.gnu.org
Subject: Re: bug#17056: dfa.c patch for systems with no locale support
Date: Sun, 23 Mar 2014 14:16:47 -0700
[Message part 3 (text/plain, inline)]
Aharon Robbins wrote:

> See the original report below

I downloaded the DJGPP sources.  LC_ALL is defined unless one compiles 
as a freestanding environment, in which case neither LC_ALL nor 
setlocale are declared.  So my guess is that your correspondent is using 
a freestanding environment somehow, and the patch that I suggested 
should work.  It's better to avoid #ifdefs inside functions so I 
installed this into the grep master (see attached) and am marking this 
as done; we can always resurrect it if my guess is wrong.

[0001-dfa-port-to-freestanding-DJGPP-Bug-17056.patch (text/plain, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Aharon Robbins <arnold <at> skeeve.com>
To: bug-grep <at> gnu.org
Subject: dfa.c patch for systems with no locale support
Date: Fri, 21 Mar 2014 13:40:17 +0200
Hi.

This turned up in testing on DJGPP.  Thanks,

Arnold
--------------------------
diff --git a/dfa.c b/dfa.c
index 8771bbe..813c239 100644
--- a/dfa.c
+++ b/dfa.c
@@ -820,9 +820,13 @@ using_simple_locale (void)
       static int unibyte_c = -1;
       if (unibyte_c < 0)
         {
+#ifdef LC_ALL
           char *locale = setlocale (LC_ALL, NULL);
           unibyte_c = (locale && (STREQ (locale, "C")
                                   || STREQ (locale, "POSIX")));
+#else
+          unibyte_c = 1;
+#endif
         }
       return unibyte_c;
     }



This bug report was last modified 11 years and 112 days ago.

Previous Next


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