aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-03-27 18:16:47 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-03-27 18:16:47 +0200
commit17cba1b73bd28fc1579e1738db638da5a687def1 (patch)
treed829e3b96d92eab37ed6c68e1dee4776ea69dbf2
parent4dad96038318ee5c6fd0c8d1c13d55da2685882d (diff)
downloadegawk-17cba1b73bd28fc1579e1738db638da5a687def1.tar.gz
egawk-17cba1b73bd28fc1579e1738db638da5a687def1.tar.bz2
egawk-17cba1b73bd28fc1579e1738db638da5a687def1.zip
Code rearrangement to avoid a warning.
-rw-r--r--ChangeLog4
-rw-r--r--main.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index decfe3be..971541cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
* Makefile.am (SUBDIRS): Move extension back into the middle of
the list so that `make check' without a prior `make' works.
+ Unrelated:
+
+ * main.c (main): Move env_lc into ifdef for LIBC_IS_BORKED.
+
2013-03-20 Arnold D. Robbins <arnold@skeeve.com>
For systems where libc is borked (MirBSD, maybe others).
diff --git a/main.c b/main.c
index e2aff0c9..2a7fbc20 100644
--- a/main.c
+++ b/main.c
@@ -210,7 +210,6 @@ main(int argc, char **argv)
char *extra_stack;
int have_srcfile = 0;
SRCFILE *s;
- const char *env_lc;
/* do these checks early */
if (getenv("TIDYMEM") != NULL)
@@ -263,11 +262,15 @@ main(int argc, char **argv)
gawk_mb_cur_max = MB_CUR_MAX;
/* Without MBS_SUPPORT, gawk_mb_cur_max is 1. */
#ifdef LIBC_IS_BORKED
+{
+ const char *env_lc;
+
env_lc = getenv("LC_ALL");
if (env_lc == NULL)
env_lc = getenv("LANG");
if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c')
gawk_mb_cur_max = 1;
+}
#endif
/* init the cache for checking bytes if they're characters */