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-3834-g71f74c


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-3834-g71f74c4
Date: Sun, 13 Oct 2019 14:29:34 -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  71f74c483838db2e18a7756469aa8c7edc76c33f (commit)
      from  8f330804cf3061aacf627ca63f6483207230d7b6 (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=71f74c483838db2e18a7756469aa8c7edc76c33f

commit 71f74c483838db2e18a7756469aa8c7edc76c33f
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Oct 13 14:29:16 2019 -0400

    Fix assigning typed regex to FS and RS.

diff --git a/ChangeLog b/ChangeLog
index 858bdaa..fa78a69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-10-13         Arnold D. Robbins     <address@hidden>
+
+       Fix handling of assigning @/.../ to FS and RS. Thanks
+       to Stephane Chazelas <address@hidden>
+       for the report.
+
+       * field.c (set_FS): Check for REGEX in the flags.
+       * io.c (set_RS): Ditto.
+
 2019-10-04         Arnold D. Robbins     <address@hidden>
 
        * config.guess, config.sub, install-sh: Updated from GNULIB.
diff --git a/field.c b/field.c
index feba8fd..8814233 100644
--- a/field.c
+++ b/field.c
@@ -1311,7 +1311,7 @@ choose_fs_function:
                        warned = true;
                        lintwarn(_("null string for `FS' is a gawk extension"));
                }
-       } else if (fs->stlen > 1) {
+       } else if (fs->stlen > 1 || (fs->flags & REGEX) != 0) {
                if (do_lint_old)
                        lintwarn(_("old awk does not support regexps as value 
of `FS'"));
                set_parser(re_parse_field);
diff --git a/io.c b/io.c
index 710314c..4bf389b 100644
--- a/io.c
+++ b/io.c
@@ -4066,7 +4066,7 @@ set_RS()
        if (RS->stlen == 0) {
                RS_is_null = true;
                matchrec = rsnullscan;
-       } else if (RS->stlen > 1 && ! do_traditional) {
+       } else if ((RS->stlen > 1 || (RS->flags & REGEX) != 0) && ! 
do_traditional) {
                static bool warned = false;
 
                RS_re[0] = make_regexp(RS->stptr, RS->stlen, false, true, true);
diff --git a/test/ChangeLog b/test/ChangeLog
index 956a0ff..0ec118e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,10 @@
+2019-10-13         Arnold D. Robbins     <address@hidden>
+
+       * Makefile.am (EXTRA_DISTS): New tests, typedregex5 and
+       typedregex6.
+       * typedregex5.awk, typedregex5.ok, typedregex6.in,
+       typedregex5.in, typedregex6.awk, typedregex6.ok: New files.
+
 2019-09-24         Jürgen Kahrs Google   <address@hidden>
 
        * Makefile.am (EXTRA_DISTS): New test, mpfranswer42.
diff --git a/test/Makefile.am b/test/Makefile.am
index 6276742..053ff54 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1243,6 +1243,12 @@ EXTRA_DIST = \
        typedregex3.ok \
        typedregex4.awk \
        typedregex4.ok \
+       typedregex5.awk \
+       typedregex5.in \
+       typedregex5.ok \
+       typedregex6.awk \
+       typedregex6.in \
+       typedregex6.ok \
        typeof1.awk \
        typeof1.ok \
        typeof2.awk \
@@ -1384,6 +1390,7 @@ GAWK_EXT_TESTS = \
        splitarg4 strftfld strftime strtonum strtonum1 switch2 symtab1 symtab2 \
        symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \
        timeout typedregex1 typedregex2 typedregex3 typedregex4 \
+       typedregex5 typedregex6 \
        typeof1 typeof2 typeof3 typeof4 typeof5 \
        watchpoint1
 
diff --git a/test/Makefile.in b/test/Makefile.in
index f5450ff..357f3b1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1502,6 +1502,12 @@ EXTRA_DIST = \
        typedregex3.ok \
        typedregex4.awk \
        typedregex4.ok \
+       typedregex5.awk \
+       typedregex5.in \
+       typedregex5.ok \
+       typedregex6.awk \
+       typedregex6.in \
+       typedregex6.ok \
        typeof1.awk \
        typeof1.ok \
        typeof2.awk \
@@ -1643,6 +1649,7 @@ GAWK_EXT_TESTS = \
        splitarg4 strftfld strftime strtonum strtonum1 switch2 symtab1 symtab2 \
        symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \
        timeout typedregex1 typedregex2 typedregex3 typedregex4 \
+       typedregex5 typedregex6 \
        typeof1 typeof2 typeof3 typeof4 typeof5 \
        watchpoint1
 
@@ -4793,6 +4800,16 @@ typedregex3:
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+typedregex5:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  < "$(srcdir)"/$@.in >_$@ 2>&1 || 
echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+typedregex6:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  < "$(srcdir)"/$@.in >_$@ 2>&1 || 
echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 typeof1:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
diff --git a/test/Maketests b/test/Maketests
index a17bf90..3e443f5 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1966,6 +1966,16 @@ typedregex3:
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+typedregex5:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  < "$(srcdir)"/$@.in >_$@ 2>&1 || 
echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+typedregex6:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  < "$(srcdir)"/$@.in >_$@ 2>&1 || 
echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 typeof1:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? 
>>_$@
diff --git a/test/typedregex5.awk b/test/typedregex5.awk
new file mode 100644
index 0000000..f702543
--- /dev/null
+++ b/test/typedregex5.awk
@@ -0,0 +1,2 @@
+BEGIN { FS = @/./ }
+{ print typeof(FS), $1, NF }
diff --git a/test/typedregex5.in b/test/typedregex5.in
new file mode 100644
index 0000000..7aff658
--- /dev/null
+++ b/test/typedregex5.in
@@ -0,0 +1 @@
+ab.c
diff --git a/test/typedregex5.ok b/test/typedregex5.ok
new file mode 100644
index 0000000..b986ed9
--- /dev/null
+++ b/test/typedregex5.ok
@@ -0,0 +1 @@
+regexp  5
diff --git a/test/typedregex6.awk b/test/typedregex6.awk
new file mode 100644
index 0000000..c2d04e6
--- /dev/null
+++ b/test/typedregex6.awk
@@ -0,0 +1,2 @@
+BEGIN { RS = @/./ }
+{ printf("<%s> <<%s>>\n", $0, RT) }
diff --git a/test/typedregex6.in b/test/typedregex6.in
new file mode 100644
index 0000000..7aff658
--- /dev/null
+++ b/test/typedregex6.in
@@ -0,0 +1 @@
+ab.c
diff --git a/test/typedregex6.ok b/test/typedregex6.ok
new file mode 100644
index 0000000..39550e8
--- /dev/null
+++ b/test/typedregex6.ok
@@ -0,0 +1,6 @@
+<> <<a>>
+<> <<b>>
+<> <<.>>
+<> <<c>>
+<> <<
+>>

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

Summary of changes:
 ChangeLog            |  9 +++++++++
 field.c              |  2 +-
 io.c                 |  2 +-
 test/ChangeLog       |  7 +++++++
 test/Makefile.am     |  7 +++++++
 test/Makefile.in     | 17 +++++++++++++++++
 test/Maketests       | 10 ++++++++++
 test/typedregex5.awk |  2 ++
 test/typedregex5.in  |  1 +
 test/typedregex5.ok  |  1 +
 test/typedregex6.awk |  2 ++
 test/typedregex6.in  |  1 +
 test/typedregex6.ok  |  6 ++++++
 13 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 test/typedregex5.awk
 create mode 100644 test/typedregex5.in
 create mode 100644 test/typedregex5.ok
 create mode 100644 test/typedregex6.awk
 create mode 100644 test/typedregex6.in
 create mode 100644 test/typedregex6.ok


hooks/post-receive
-- 
gawk



reply via email to

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