aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-04-27 18:17:24 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-04-27 18:17:24 +0300
commit23fb6f0d2db3488fa85f6f7c975aba56be81806e (patch)
tree7348170b73a3f6ca675fd7e761200f3a84e19b3e
parent2baa59b4f9e567dbf15900980d13eb6ab1317fdd (diff)
parentab74a66c1b92c3d84ce39d764794225acc630a62 (diff)
downloadegawk-23fb6f0d2db3488fa85f6f7c975aba56be81806e.tar.gz
egawk-23fb6f0d2db3488fa85f6f7c975aba56be81806e.tar.bz2
egawk-23fb6f0d2db3488fa85f6f7c975aba56be81806e.zip
Merge branch 'gawk-4.1-stable'
-rw-r--r--ChangeLog5
-rw-r--r--io.c2
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am10
-rw-r--r--test/Makefile.in10
-rw-r--r--test/rscompat.awk2
-rw-r--r--test/rscompat.in2
-rw-r--r--test/rscompat.ok3
8 files changed, 36 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6fc97a23..e6d12988 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * io.c (set_RS): Use rs1scan if do_traditional, even if length
+ of RS is > 1.
+
2016-04-24 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
diff --git a/io.c b/io.c
index e036b87d..b81ebf3f 100644
--- a/io.c
+++ b/io.c
@@ -3841,7 +3841,7 @@ set_RS()
if (RS->stlen == 0) {
RS_is_null = true;
matchrec = rsnullscan;
- } else if (RS->stlen > 1) {
+ } else if (RS->stlen > 1 && ! do_traditional) {
static bool warned = false;
RS_re_yes_case = make_regexp(RS->stptr, RS->stlen, false, true, true);
diff --git a/test/ChangeLog b/test/ChangeLog
index f58a2ef3..d9ec5498 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (rscompat): New test.
+ * rscompat.awk, rscompat.in, rscompat.ok: New files.
+
2016-04-24 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (pty1): Ignore errors.
diff --git a/test/Makefile.am b/test/Makefile.am
index 09bcc769..ea483401 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -871,6 +871,9 @@ EXTRA_DIST = \
rs.awk \
rs.in \
rs.ok \
+ rscompat.awk \
+ rscompat.in \
+ rscompat.ok \
rsgetline.awk \
rsgetline.in \
rsgetline.ok \
@@ -1116,7 +1119,7 @@ BASIC_TESTS = \
rand randtest range1 readbuf rebrackloc rebt8b1 redfilnm \
regeq regexpbrack regexpbrack2 \
regexprange regrange reindops \
- reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
+ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
rstest3 rstest4 rstest5 rswhite \
scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \
splitvar splitwht strcat1 strnum1 strtod subamp subi18n \
@@ -2232,6 +2235,11 @@ pty1:
$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ;; \
esac
+rscompat:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 849dd6d4..7cbf8003 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1128,6 +1128,9 @@ EXTRA_DIST = \
rs.awk \
rs.in \
rs.ok \
+ rscompat.awk \
+ rscompat.in \
+ rscompat.ok \
rsgetline.awk \
rsgetline.in \
rsgetline.ok \
@@ -1372,7 +1375,7 @@ BASIC_TESTS = \
rand randtest range1 readbuf rebrackloc rebt8b1 redfilnm \
regeq regexpbrack regexpbrack2 \
regexprange regrange reindops \
- reparse resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
+ reparse resplit rri1 rs rscompat rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
rstest3 rstest4 rstest5 rswhite \
scalar sclforin sclifin sortempty sortglos splitargv splitarr splitdef \
splitvar splitwht strcat1 strnum1 strtod subamp subi18n \
@@ -2669,6 +2672,11 @@ pty1:
*) AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ ; \
$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ;; \
esac
+
+rscompat:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/rscompat.awk b/test/rscompat.awk
new file mode 100644
index 00000000..9415c704
--- /dev/null
+++ b/test/rscompat.awk
@@ -0,0 +1,2 @@
+BEGIN { RS = "bar" }
+{ print $1, $2 }
diff --git a/test/rscompat.in b/test/rscompat.in
new file mode 100644
index 00000000..eb337e58
--- /dev/null
+++ b/test/rscompat.in
@@ -0,0 +1,2 @@
+0foobar0faz
+1foobar1faz
diff --git a/test/rscompat.ok b/test/rscompat.ok
new file mode 100644
index 00000000..19cd9fbe
--- /dev/null
+++ b/test/rscompat.ok
@@ -0,0 +1,3 @@
+0foo
+ar0faz 1foo
+ar1faz