aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2011-08-11 04:58:20 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2011-08-11 04:58:20 +0000
commit0abe4b0321121e3abc986beff255c2a4b3addc82 (patch)
tree46c92586fb856e2628cacf0ec2e2d042d70b3d90
parent9cb3faa6600faf227157090f70a6ec850ac1ef75 (diff)
downloadsrc-0abe4b0321121e3abc986beff255c2a4b3addc82.tar.gz
src-0abe4b0321121e3abc986beff255c2a4b3addc82.zip
Vendor import of bwk's 10-Aug-2011 release.
Notes
Notes: svn path=/vendor/one-true-awk/dist/; revision=224772
-rw-r--r--FIXES4
-rw-r--r--lib.c9
-rw-r--r--main.c2
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 <stdio.h>