[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-736
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-736-ge982b94 |
Date: |
Fri, 18 Sep 2015 11:56:00 +0000 |
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, gawk-4.1-stable has been updated
via e982b94885a2c9136fe37322d8b96346837f9389 (commit)
from 26ab51cc70109abd04ac04ff75bb58abb2eb957f (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=e982b94885a2c9136fe37322d8b96346837f9389
commit e982b94885a2c9136fe37322d8b96346837f9389
Author: Arnold D. Robbins <address@hidden>
Date: Fri Sep 18 14:55:07 2015 +0300
Bug fix to FPAT field parsing.
diff --git a/ChangeLog b/ChangeLog
index 209c07f..2d89bc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-09-18 Arnold D. Robbins <address@hidden>
+
+ * field.c (fpat_parse_field): Always use rp->non_empty instead
+ of only if in_middle. The latter can be true even if we've
+ already parsed part of the record. Thanks to Ed Morton
+ for the bug report.
+
2015-09-04 Arnold D. Robbins <address@hidden>
* profile.c (pp_num): Use format_val to print integral values
diff --git a/field.c b/field.c
index 6a7c6b1..ed31098 100644
--- a/field.c
+++ b/field.c
@@ -1598,9 +1598,8 @@ fpat_parse_field(long up_to, /* parse only up to
this field number */
if (in_middle) {
regex_flags |= RE_NO_BOL;
- non_empty = rp->non_empty;
- } else
- non_empty = false;
+ }
+ non_empty = rp->non_empty;
eosflag = false;
need_to_set_sep = true;
diff --git a/test/ChangeLog b/test/ChangeLog
index 2de6750..10bccd5 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-18 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (fpat5): New test.
+ * fpat5.awk, fpat5.in, fpat5.ok: New files.
+
2015-09-04 Arnold D. Robbins <address@hidden>
* profile.ok: Updated after code change.
diff --git a/test/Makefile.am b/test/Makefile.am
index 14ebf54..6996b1c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -290,6 +290,9 @@ EXTRA_DIST = \
fpat3.ok \
fpat4.awk \
fpat4.ok \
+ fpat5.awk \
+ fpat5.in \
+ fpat5.ok \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
@@ -1058,7 +1061,7 @@ GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars
exit \
- fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
+ fieldwdth fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
diff --git a/test/Makefile.in b/test/Makefile.in
index a78b3e6..ba5da05 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -547,6 +547,9 @@ EXTRA_DIST = \
fpat3.ok \
fpat4.awk \
fpat4.ok \
+ fpat5.awk \
+ fpat5.in \
+ fpat5.ok \
fpatnull.awk \
fpatnull.in \
fpatnull.ok \
@@ -1314,7 +1317,7 @@ GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
colonwarn clos1way crlf dbugeval delsub devfd devfd1 devfd2 dumpvars
exit \
- fieldwdth fpat1 fpat2 fpat3 fpat4 fpatnull fsfwfs funlen \
+ fieldwdth fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \
functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
genpot gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
icasefs icasers id igncdym igncfs ignrcas2 ignrcase \
@@ -3540,6 +3543,11 @@ fpat4:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+fpat5:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
fpatnull:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 651ff03..7c55a44 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1017,6 +1017,11 @@ fpat4:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+fpat5:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
fpatnull:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden <
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/fpat5.awk b/test/fpat5.awk
new file mode 100644
index 0000000..b508f06
--- /dev/null
+++ b/test/fpat5.awk
@@ -0,0 +1,8 @@
+BEGIN {
+ FPAT = "([^,]*)|(\"[^\"]+\")"
+ OFS = ";"
+}
+
+p != 0 { print NF }
+
+{ $1 = $1 ; print }
diff --git a/test/fpat5.in b/test/fpat5.in
new file mode 100644
index 0000000..15d874e
--- /dev/null
+++ b/test/fpat5.in
@@ -0,0 +1 @@
+"A","B","C"
diff --git a/test/fpat5.ok b/test/fpat5.ok
new file mode 100644
index 0000000..cc9295c
--- /dev/null
+++ b/test/fpat5.ok
@@ -0,0 +1 @@
+"A";"B";"C"
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
field.c | 5 ++---
test/ChangeLog | 5 +++++
test/Makefile.am | 5 ++++-
test/Makefile.in | 10 +++++++++-
test/Maketests | 5 +++++
test/fpat5.awk | 8 ++++++++
test/fpat5.in | 1 +
test/fpat5.ok | 1 +
9 files changed, 42 insertions(+), 5 deletions(-)
create mode 100644 test/fpat5.awk
create mode 100644 test/fpat5.in
create mode 100644 test/fpat5.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-736-ge982b94,
Arnold Robbins <=