[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17056: dfa.c patch for systems with no locale support
From: |
Aharon Robbins |
Subject: |
bug#17056: dfa.c patch for systems with no locale support |
Date: |
Thu, 27 Mar 2014 20:48:38 +0200 |
User-agent: |
Heirloom mailx 12.5 6/20/10 |
Hi Paul.
> Date: Wed, 26 Mar 2014 21:39:48 -0700
> From: Paul Eggert <address@hidden>
> To: Aharon Robbins <address@hidden>, address@hidden
>
> Aharon Robbins wrote:
> > we should be defining this as
> >
> > # define setlocale(category, locale) ("C")
>
> Thanks, that sounds right. I installed the attached patch.
Actually, after a night's sleep, I think that was wrong. What if
the system's setlocale() actually returns NULL? I suggest
the below change to master.
Thanks,
Arnold
----------------------------------------------------------------
diff --git a/src/dfa.c b/src/dfa.c
index f88ff2a..0fd8944 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -37,7 +37,7 @@
/* Gawk doesn't use Gnulib, so don't assume that setlocale and
static_assert are present. */
#ifndef LC_ALL
-# define setlocale(category, locale) "C"
+# define setlocale(category, locale) NULL
#endif
#ifndef static_assert
# define static_assert(cond, diagnostic) \
@@ -784,8 +784,9 @@ using_simple_locale (void)
if (unibyte_c < 0)
{
char const *locale = setlocale (LC_ALL, NULL);
- unibyte_c = (locale && (STREQ (locale, "C")
- || STREQ (locale, "POSIX")));
+ unibyte_c = (locale == NULL
+ || STREQ (locale, "C")
+ || STREQ (locale, "POSIX"));
}
return unibyte_c;
}
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/21
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/21
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/23
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/23
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/26
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/27
- bug#17056: dfa.c patch for systems with no locale support,
Aharon Robbins <=
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/27
- bug#17056: dfa.c patch for systems with no locale support, Eric Blake, 2014/03/27
- bug#17056: dfa.c patch for systems with no locale support, Aharon Robbins, 2014/03/28
- bug#17056: dfa.c patch for systems with no locale support, Paul Eggert, 2014/03/28