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: Aharon Robbins <arnold <at> skeeve.com>
To: eggert <at> cs.ucla.edu, eblake <at> redhat.com, arnold <at> skeeve.com, 17056-done <at> debbugs.gnu.org
Subject: bug#17056: dfa.c patch for systems with no locale support
Date: Fri, 28 Mar 2014 13:30:54 +0300
Me: 
> >> What if
> >> the system's setlocale() actually returns NULL?

Paul:
> > Then we don't know what the locale is.  Perhaps setlocale ran out of
> > memory and so returned NULL.  If so, subsequent calls might use some
> > weird Turkish locale with multibyte characters.  So it sounds safer to
> > assume the worst in that case.

Eric:
> This is in main().  POSIX guarantees that until setlocale() is called
> for the first time, we are in the C locale.  If you were in a library, I
> could buy the argument of setlocale() returning NULL as indicative of
> some rare error.  But in main(), where you are the first call, the only
> thing that a NULL return implies is that your attempt to change the
> locale had no effect, so it remains at the locale it was before, which
> is the C locale since all programs start in the C locale.

So, are we for or against my suggested change?  Sounds like "for",
but I'm not sure.

Thanks,

Arnold




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

Previous Next


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