From 0abe4b0321121e3abc986beff255c2a4b3addc82 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 11 Aug 2011 04:58:20 +0000 Subject: [PATCH 1/2] Vendor import of bwk's 10-Aug-2011 release. --- FIXES | 4 ++++ lib.c | 9 +++++++-- main.c | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/FIXES b/FIXES index a802ad418783..4b28708f99f2 100644 --- a/FIXES +++ b/FIXES @@ -25,6 +25,10 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Aug 10, 2011: + another fix to avoid core dump with -v; again, many thanks + to ruslan ermilov. + Aug 7, 2011: split(s, a, //) now behaves the same as split(s, a, "") diff --git a/lib.c b/lib.c index 5da601aa8e7e..5eeb53d4679d 100644 --- a/lib.c +++ b/lib.c @@ -89,8 +89,13 @@ void initgetrec(void) char *p; for (i = 1; i < *ARGC; i++) { - if (!isclvar(p = getargv(i))) { /* find 1st real filename */ - setsval(lookup("FILENAME", symtab), getargv(i)); + p = getargv(i); /* find 1st real filename */ + if (p == NULL || *p == '\0') { /* deleted or zapped */ + argno++; + continue; + } + if (!isclvar(p)) { + setsval(lookup("FILENAME", symtab), p); return; } setclvar(p); /* a commandline assignment before filename */ diff --git a/main.c b/main.c index bd9eeeeaf90a..3c4dbf56af33 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 20110807"; +const char *version = "version 20110810"; #define DEBUG #include From b0f5e94e3f34717e78a265dc61c6c45406a258d0 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 11 Aug 2011 10:24:09 +0000 Subject: [PATCH 2/2] Corrected description of the bugfix; distfile was updated. --- FIXES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FIXES b/FIXES index 4b28708f99f2..a708027461ce 100644 --- a/FIXES +++ b/FIXES @@ -26,7 +26,7 @@ This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. Aug 10, 2011: - another fix to avoid core dump with -v; again, many thanks + another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Aug 7, 2011: