aboutsummaryrefslogtreecommitdiffstats
path: root/dfa.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-03-21 13:41:21 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-03-21 13:41:21 +0200
commit371eaf153f33f9db15d4b00aa4d873e39afee4c1 (patch)
tree3e16e4c432eb3e6238f26bcd77cab65e2bd5a56a /dfa.c
parentd69f7993a398d89e00d4cae154f07790f1419a09 (diff)
downloadegawk-371eaf153f33f9db15d4b00aa4d873e39afee4c1.tar.gz
egawk-371eaf153f33f9db15d4b00aa4d873e39afee4c1.tar.bz2
egawk-371eaf153f33f9db15d4b00aa4d873e39afee4c1.zip
Fix dfa for systems without locales.
Diffstat (limited to 'dfa.c')
-rw-r--r--dfa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dfa.c b/dfa.c
index 8771bbee..813c239b 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;
}