summaryrefslogtreecommitdiff
path: root/usr.bin/awk/lex.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-08 00:12:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-08 00:12:41 +0000
commit63bf6a6ce49fd2e45c947f6b6105a958365f6858 (patch)
tree4f5c4ab654cf0758536b2dfa6be6789218301d47 /usr.bin/awk/lex.c
parent9ba2ab292e66a71b170f4de3e910e8c47673b4a4 (diff)
Update to latest version of the One True Awk. See the FIXES file
for details.
Diffstat (limited to 'usr.bin/awk/lex.c')
-rw-r--r--usr.bin/awk/lex.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/awk/lex.c b/usr.bin/awk/lex.c
index 99ff3bb55a4..809e190af8f 100644
--- a/usr.bin/awk/lex.c
+++ b/usr.bin/awk/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.4 1999/12/08 23:09:45 millert Exp $ */
+/* $OpenBSD: lex.c,v 1.5 2001/09/08 00:12:40 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -296,18 +296,20 @@ int yylex(void)
input(); yylval.i = POWEQ; RET(ASGNOP);
} else
RET(POWER);
-
+
case '$':
/* BUG: awkward, if not wrong */
c = gettok(&buf, &bufsize);
- if (c == '(' || c == '[' || (infunc && isarg(buf) >= 0)) {
- unputstr(buf);
- RET(INDIRECT);
- } else if (isalpha(c)) {
+ if (isalpha(c)) {
if (strcmp(buf, "NF") == 0) { /* very special */
unputstr("(NF)");
RET(INDIRECT);
}
+ c = peek();
+ if (c == '(' || c == '[' || (infunc && isarg(buf) >= 0)) {
+ unputstr(buf);
+ RET(INDIRECT);
+ }
yylval.cp = setsymtab(buf, "", 0.0, STR|NUM, symtab);
RET(IVAR);
} else {