aboutsummaryrefslogtreecommitdiffstats
path: root/lib.c
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 /lib.c
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
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c9
1 files changed, 7 insertions, 2 deletions
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 */