diff options
author | ru <ru@FreeBSD.org> | 2011-08-11 10:29:10 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2011-08-11 10:29:10 +0000 |
commit | 09961aaff67f444fe11e41a761475d3cda5b7a36 (patch) | |
tree | a20eea0c5240ad883ee6167ee612a5e57b625a9e /contrib/one-true-awk/lib.c | |
parent | 6bc583d0fe2dccfe70ecc5f20834c56a22f884c4 (diff) | |
download | FreeBSD-src-09961aaff67f444fe11e41a761475d3cda5b7a36.zip FreeBSD-src-09961aaff67f444fe11e41a761475d3cda5b7a36.tar.gz |
- Merged awk upstream that includes a fix for a bug exposed by kmod_syms.mk.
- Provide a build aid for those who already have a buggy awk(1) installed.
Approved by: re (kib)
Diffstat (limited to 'contrib/one-true-awk/lib.c')
-rw-r--r-- | contrib/one-true-awk/lib.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/one-true-awk/lib.c b/contrib/one-true-awk/lib.c index 5da601a..5eeb53d 100644 --- a/contrib/one-true-awk/lib.c +++ b/contrib/one-true-awk/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 */ |