summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-04-07 21:43:38 +0300
committerArnold D. Robbins <arnold@skeeve.com>2019-04-07 21:43:38 +0300
commit8ae4556cd755b7902afba7ab89313d5aa8801173 (patch)
tree2bb7041df050d8744d7fa2517ac0aca460ea7a9b /eval.c
parent12a5a583e98ba7a6886407df6df74a1dbb65ae64 (diff)
downloadgawk-8ae4556cd755b7902afba7ab89313d5aa8801173.tar.gz
Single-byte locales use locale settings for ignoring case.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/eval.c b/eval.c
index 4650150b..132c8509 100644
--- a/eval.c
+++ b/eval.c
@@ -104,6 +104,12 @@ char casetable[] = {
'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
/* Latin 1: */
+ /*
+ * 4/2019: This is now overridden; in single byte locales
+ * we call load_casetable from main and it fills in the values
+ * based on the current locale. In particular, we want LC_ALL=C
+ * to work correctly for values >= 0200.
+ */
C('\200'), C('\201'), C('\202'), C('\203'), C('\204'), C('\205'), C('\206'), C('\207'),
C('\210'), C('\211'), C('\212'), C('\213'), C('\214'), C('\215'), C('\216'), C('\217'),
C('\220'), C('\221'), C('\222'), C('\223'), C('\224'), C('\225'), C('\226'), C('\227'),
@@ -201,18 +207,12 @@ load_casetable(void)
{
#if defined(LC_CTYPE)
int i;
- char *cp;
static bool loaded = false;
if (loaded || do_traditional)
return;
loaded = true;
- cp = setlocale(LC_CTYPE, NULL);
-
- /* this is not per standard, but it's pretty safe */
- if (cp == NULL || strcmp(cp, "C") == 0 || strcmp(cp, "POSIX") == 0)
- return;
#ifndef USE_EBCDIC
/* use of isalpha is ok here (see is_alpha in awkgram.y) */
@@ -710,7 +710,7 @@ set_IGNORECASE()
warned = true;
lintwarn(_("`IGNORECASE' is a gawk extension"));
}
- load_casetable();
+
if (do_traditional)
IGNORECASE = false;
else