aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-03-20 19:06:08 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-03-20 19:06:08 +0200
commit13b8d9034b58c51e06c05c70fe89a34ad1c7dcd9 (patch)
tree84bc18fa33af998c37aef00f1df7a2a221a2a955 /main.c
parent15c90ed3319a297680282dba3a24cbdeaca7e8bb (diff)
downloadegawk-13b8d9034b58c51e06c05c70fe89a34ad1c7dcd9.tar.gz
egawk-13b8d9034b58c51e06c05c70fe89a34ad1c7dcd9.tar.bz2
egawk-13b8d9034b58c51e06c05c70fe89a34ad1c7dcd9.zip
Additional fixes for MirBSD. Now passes make check.
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.c b/main.c
index 785935e4..e2aff0c9 100644
--- a/main.c
+++ b/main.c
@@ -210,6 +210,7 @@ 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)
@@ -261,6 +262,13 @@ 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
+ 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 */
init_btowc_cache();