gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-3693-g8ae455


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-3693-g8ae4556
Date: Sun, 7 Apr 2019 14:48:09 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  8ae4556cd755b7902afba7ab89313d5aa8801173 (commit)
      from  12a5a583e98ba7a6886407df6df74a1dbb65ae64 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=8ae4556cd755b7902afba7ab89313d5aa8801173

commit 8ae4556cd755b7902afba7ab89313d5aa8801173
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Apr 7 21:43:38 2019 +0300

    Single-byte locales use locale settings for ignoring case.

diff --git a/ChangeLog b/ChangeLog
index 37de791..7eacd7a 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-04-05         Arnold D. Robbins     <address@hidden>
+
+       * eval.c (load_casetable): Always use the locale's settings.
+       (set_IGNORECASE): Don't call load_casetable.
+       * main.c (main): Call load_casetable if in a single-byte locale.
+
 2019-03-22         Arnold D. Robbins     <address@hidden>
 
        * config.guess: Updated from GNULIB.
diff --git a/NEWS b/NEWS
index d87e0d5..0496512 100644
--- a/NEWS
+++ b/NEWS
@@ -44,5 +44,8 @@ Changes from 4.2.1 to 5.0.0
 
        gawk -e 'BEGIN {' -e 'print "hello" }'
 
-12. A number of bugs, some of them quite significant, have been fixed.
+12. Gawk now uses the locale settings for ignoring case in single byte
+    locales, instead of hardwiring in Latin-1.
+
+13. A number of bugs, some of them quite significant, have been fixed.
     See the ChangeLog for details.
diff --git a/eval.c b/eval.c
index 4650150..132c850 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
diff --git a/main.c b/main.c
index e2bcd72..d6e3426 100644
--- a/main.c
+++ b/main.c
@@ -320,6 +320,10 @@ main(int argc, char **argv)
        /* init the cache for checking bytes if they're characters */
        init_btowc_cache();
 
+       /* set up the single byte case table */
+       if (gawk_mb_cur_max == 1)
+               load_casetable();
+
        if (do_nostalgia)
                nostalgia();
 
diff --git a/test/ChangeLog b/test/ChangeLog
index de10e22..389edc9 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-07         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (EXTRA_DIST): New test: range2. Needs LC_ALL=C.
+       * range2.awk, range2.ok: New files.
+
 2019-03-17         Arnold D. Robbins     <address@hidden>
 
        * Makefile.am (mbprintf5): Add a minus so that the tests
diff --git a/test/Makefile.am b/test/Makefile.am
index 37d4984..57d0444 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -946,6 +946,8 @@ EXTRA_DIST = \
        range1.awk \
        range1.in \
        range1.ok \
+       range2.awk \
+       range2.ok \
        readbuf.awk \
        readbuf.ok \
        readdir.awk \
@@ -1301,7 +1303,7 @@ BASIC_TESTS = \
        paramasfunc1 paramasfunc2 paramdup paramres paramtyp paramuninitglobal \
        parse1 parsefld parseme pcntplus posix2008sub prdupval prec printf0 \
        printf1 printfchar prmarscl prmreuse prt1eval prtoeval \
-       rand randtest range1 readbuf rebrackloc rebt8b1 rebuild redfilnm regeq \
+       rand randtest range1 range2 readbuf rebrackloc rebt8b1 rebuild redfilnm 
regeq \
        regexpbrack regexpbrack2 regexprange regrange reindops reparse resplit \
        rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 \
        rstest4 rstest5 rswhite \
@@ -1422,7 +1424,7 @@ CHECK_MPFR = \
 
 # Lists of tests that need particular locales
 NEED_LOCALE_C = \
-       clos1way gsubtst6
+       clos1way gsubtst6 range2
 
 NEED_LOCALE_EN = \
        backbigs1 backsmalls1 backsmalls2 concat4 dfamb1 ignrcas2 lc_num1 \
diff --git a/test/Makefile.in b/test/Makefile.in
index b4c62c1..fea5458 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1205,6 +1205,8 @@ EXTRA_DIST = \
        range1.awk \
        range1.in \
        range1.ok \
+       range2.awk \
+       range2.ok \
        readbuf.awk \
        readbuf.ok \
        readdir.awk \
@@ -1560,7 +1562,7 @@ BASIC_TESTS = \
        paramasfunc1 paramasfunc2 paramdup paramres paramtyp paramuninitglobal \
        parse1 parsefld parseme pcntplus posix2008sub prdupval prec printf0 \
        printf1 printfchar prmarscl prmreuse prt1eval prtoeval \
-       rand randtest range1 readbuf rebrackloc rebt8b1 rebuild redfilnm regeq \
+       rand randtest range1 range2 readbuf rebrackloc rebt8b1 rebuild redfilnm 
regeq \
        regexpbrack regexpbrack2 regexprange regrange reindops reparse resplit \
        rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 \
        rstest4 rstest5 rswhite \
@@ -1683,7 +1685,7 @@ CHECK_MPFR = \
 
 # Lists of tests that need particular locales
 NEED_LOCALE_C = \
-       clos1way gsubtst6
+       clos1way gsubtst6 range2
 
 NEED_LOCALE_EN = \
        backbigs1 backsmalls1 backsmalls2 concat4 dfamb1 ignrcas2 lc_num1 \
@@ -3584,6 +3586,12 @@ range1:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+range2:
+       @echo $@
+       @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=C; export GAWKLOCALE; \
+       AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 readbuf:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 48b2433..e557cb2 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -850,6 +850,12 @@ range1:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+range2:
+       @echo $@
+       @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=C; export GAWKLOCALE; \
+       AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 readbuf:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/range2.awk b/test/range2.awk
new file mode 100644
index 0000000..c4f11ea
--- /dev/null
+++ b/test/range2.awk
@@ -0,0 +1 @@
+BEGIN { print("a" ~ /^[\300-\337]/) }
diff --git a/test/range2.ok b/test/range2.ok
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/test/range2.ok
@@ -0,0 +1 @@
+0

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |  6 ++++++
 NEWS                             |  5 ++++-
 eval.c                           | 14 +++++++-------
 main.c                           |  4 ++++
 test/ChangeLog                   |  5 +++++
 test/Makefile.am                 |  6 ++++--
 test/Makefile.in                 | 12 ++++++++++--
 test/Maketests                   |  6 ++++++
 test/range2.awk                  |  1 +
 test/{dfastress.ok => range2.ok} |  0
 10 files changed, 47 insertions(+), 12 deletions(-)
 create mode 100644 test/range2.awk
 copy test/{dfastress.ok => range2.ok} (100%)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]