diff --git a/FIXES b/FIXES index 5c33dd9..c697f34 100644 --- a/FIXES +++ b/FIXES @@ -25,6 +25,37 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Aug 23, 2018: + A long list of fixes courtesy of Arnold Robbins, + to whom profound thanks. + + 1. ofs-rebuild: OFS value used to rebuild the record was incorrect. + Fixed August 19, 2014. Revised fix August 2018. + + 2. system-status: Instead of a floating-point division by 256, use + the wait(2) macros to create a reasonable exit status. + Fixed March 12, 2016. + + 3. space: Use provided xisblank() function instead of ispace() for + matching [[:blank:]]. + + 4. a-format: Add POSIX standard %a and %A to supported formats. Check + at runtime that this format is available. + + 5. decr-NF: Decrementing NF did not change $0. This is a decades-old + bug. There are interactions with the old and new value of OFS as well. + Most of the fix came from the NetBSD awk. + + 6. string-conv: String conversions of scalars were sticky. Once a + conversion to string happened, even with OFMT, that value was used until + a new numeric value was assigned, even if OFMT differed from CONVFMT, + and also if CONVFMT changed. + + 7. unary-plus: Unary plus on a string constant returned the string. + Instead, it should convert the value to numeric and give that value. + + Also added Arnold's tests for these to awktest.tar as T.arnold. + Aug 15, 2018: fixed mangled awktest.tar (thanks, Arnold), posted all current (very minor) fixes to github / onetrueawk diff --git a/TODO b/TODO deleted file mode 100644 index 5099569..0000000 --- a/TODO +++ /dev/null @@ -1,20 +0,0 @@ -Fri Aug 10 11:11:11 IDT 2018 -============================ - -A semi-random list of things to look into. - -1. DONE. Make sure the FIXES file has everything after the date order -was reversed. - -2. DONE. Look into the problem that NF-- doesn't throw away the last field. -This a long-standing issue. - -3. DONE. Add suport for %a and %A printf formats. - -4. DONE. Look into the problem that string conversions are sticky; once -done they never change, even if OFMT or CONVFMT do. Similarly, a -conversion from OFMT becomes the permanent string value, which is -incorrect. - -5. MAYBE: Improve the test suite enough so that it can be cleaned up after -it was run, and old results can be saved for comparison. diff --git a/awktest.tar b/awktest.tar index 959b452..31c6ad9 100644 Binary files a/awktest.tar and b/awktest.tar differ diff --git a/main.c b/main.c index d292ad3..60d7c48 100644 --- a/main.c +++ b/main.c @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20130105 + fixes by arnold@skeeve.com 20180822"; +const char *version = "version 20180823"; #define DEBUG #include diff --git a/makefile b/makefile index 8f5906f..3e29e66 100644 --- a/makefile +++ b/makefile @@ -23,17 +23,19 @@ # ****************************************************************/ CFLAGS = -g -CFLAGS = -O2 CFLAGS = +CFLAGS = -O2 +# compiler options #CC = gcc -Wall -g -Wwrite-strings -CC = gcc -g -Wall -pedantic #CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing #CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +CC = gcc -g -Wall -pedantic -YACC = bison -d -y -# YACC = yacc -d +# yacc options. pick one; this varies a lot by system. #YFLAGS = -d -S +#YACC = bison -d -y +YACC = yacc -d # -S uses sprintf in yacc parser instead of sprint OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o