diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-09-18 14:56:49 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-09-18 14:56:49 +0300 |
commit | 3344e3996d0790e12f89166cfe504f4f2bc8864d (patch) | |
tree | 71045a4547cb17bcc964e8cbd7da2058597a27ab | |
parent | 4e9562fd62acf478974fc7e0627381f93101083e (diff) | |
parent | e982b94885a2c9136fe37322d8b96346837f9389 (diff) | |
download | egawk-3344e3996d0790e12f89166cfe504f4f2bc8864d.tar.gz egawk-3344e3996d0790e12f89166cfe504f4f2bc8864d.tar.bz2 egawk-3344e3996d0790e12f89166cfe504f4f2bc8864d.zip |
Merge branch 'gawk-4.1-stable' into feature/zOS-try2
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | field.c | 5 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/fpat5.awk | 8 | ||||
-rw-r--r-- | test/fpat5.in | 1 | ||||
-rw-r--r-- | test/fpat5.ok | 1 |
9 files changed, 42 insertions, 5 deletions
@@ -1,3 +1,10 @@ +2015-09-18 Arnold D. Robbins <arnold@skeeve.com> + + * 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-11 Daniel Richard G. <skunk@iSKUNK.ORG> * regcomp.h: Include strings.h, wrapped in ifdef. Revise @@ -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 9d31f04d..f9190b3e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-09-18 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (fpat5): New test. + * fpat5.awk, fpat5.in, fpat5.ok: New files. + 2015-09-04 Arnold D. Robbins <arnold@skeeve.com> * profile.ok: Updated after code change. diff --git a/test/Makefile.am b/test/Makefile.am index 781d45d4..9523a801 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 d2776b29..7403d2b9 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 \ @@ -3542,6 +3545,11 @@ fpat4: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat5: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 651ff03b..7c55a443 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1017,6 +1017,11 @@ fpat4: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fpat5: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fpatnull: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/fpat5.awk b/test/fpat5.awk new file mode 100644 index 00000000..b508f068 --- /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 00000000..15d874ef --- /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 00000000..cc9295ce --- /dev/null +++ b/test/fpat5.ok @@ -0,0 +1 @@ +"A";"B";"C" |