diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | field.c | 6 | ||||
-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/fsnul1.awk | 2 | ||||
-rw-r--r-- | test/fsnul1.in | bin | 0 -> 6 bytes | |||
-rw-r--r-- | test/fsnul1.ok | 1 |
9 files changed, 36 insertions, 3 deletions
@@ -3,6 +3,11 @@ * main.c (arg_assign): Fully bracket ifdefs around call to force_number. Thanks to Andrew Schorr for pointing out that force_number was called only if LC_NUMERIC was defined. + + Lots of files: Update copyright date. + + * field.c (set_FS): Handle FS = "\0" if RS = "". Thanks to + Janis Papanagnou for the report. 2016-05-26 Andrew J. Schorr <aschorr@telemetry-investments.com> @@ -1270,8 +1270,12 @@ choose_fs_function: } else if (fs->stptr[0] == '\\') { /* yet another special case */ strcpy(buf, "[\\\\\n]"); - } else if (fs->stptr[0] != '\n') + } else if (fs->stptr[0] == '\0') { + /* and yet another special case */ + strcpy(buf, "[\\000\n]"); + } else if (fs->stptr[0] != '\n') { sprintf(buf, "[%c\n]", fs->stptr[0]); + } } } else { if (do_posix) diff --git a/test/ChangeLog b/test/ChangeLog index 2ba62311..2e1090ce 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2016-05-30 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (fsnul1): New test. + * fsnul1.awk, fsnul1.in, fsnul1.ok: New files. + 2016-05-25 Arnold D. Robbins <arnold@skeeve.com> * arrayind1.awk: Flush writes to stderr. We hope this helps diff --git a/test/Makefile.am b/test/Makefile.am index 59656523..92e8f6e7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -316,6 +316,9 @@ EXTRA_DIST = \ fsfwfs.awk \ fsfwfs.in \ fsfwfs.ok \ + fsnul1.awk \ + fsnul1.in \ + fsnul1.ok \ fsrs.awk \ fsrs.in \ fsrs.ok \ @@ -1056,7 +1059,7 @@ BASIC_TESTS = \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ - fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ + fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsnul1 fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ getline getline2 getline3 getline4 getline5 getlnbuf getnr2tb getnr2tm \ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ diff --git a/test/Makefile.in b/test/Makefile.in index 7c201eab..34656eca 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -573,6 +573,9 @@ EXTRA_DIST = \ fsfwfs.awk \ fsfwfs.in \ fsfwfs.ok \ + fsnul1.awk \ + fsnul1.in \ + fsnul1.ok \ fsrs.awk \ fsrs.in \ fsrs.ok \ @@ -1312,7 +1315,7 @@ BASIC_TESTS = \ datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \ eofsplit exit2 exitval1 exitval2 exitval3 \ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \ - fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \ + fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsnul1 fsrs fsspcoln \ fstabplus funsemnl funsmnam funstack \ getline getline2 getline3 getline4 getline5 getlnbuf getnr2tb getnr2tm \ gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \ @@ -2908,6 +2911,11 @@ fsbs: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fsnul1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fsrs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index c16bdc25..e5bde1d2 100644 --- a/test/Maketests +++ b/test/Maketests @@ -315,6 +315,11 @@ fsbs: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +fsnul1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + fsrs: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/fsnul1.awk b/test/fsnul1.awk new file mode 100644 index 00000000..5a1b473b --- /dev/null +++ b/test/fsnul1.awk @@ -0,0 +1,2 @@ +BEGIN { FS = "\0" ; RS = "" } +{ print $2 } diff --git a/test/fsnul1.in b/test/fsnul1.in Binary files differnew file mode 100644 index 00000000..7dec250c --- /dev/null +++ b/test/fsnul1.in diff --git a/test/fsnul1.ok b/test/fsnul1.ok new file mode 100644 index 00000000..ab4a9819 --- /dev/null +++ b/test/fsnul1.ok @@ -0,0 +1 @@ +ho |