aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNeven Sajko <nsajko@gmail.com>2019-08-25 14:30:36 +0000
committerRuss Cox <rsc@golang.org>2020-01-13 14:41:28 -0500
commitbf59f0ed282f9c9b1ae0660e5af0ac86c0d247b5 (patch)
treeacd1341adf92ef9cf1eb2421a96e5afdf79bf404 /src
parenteb4aea5072dcca2dfee2ff4d551352dae73a821c (diff)
downloadplan9port-bf59f0ed282f9c9b1ae0660e5af0ac86c0d247b5.tar.gz
plan9port-bf59f0ed282f9c9b1ae0660e5af0ac86c0d247b5.tar.bz2
plan9port-bf59f0ed282f9c9b1ae0660e5af0ac86c0d247b5.zip
cmd/yacc: correctly detect end of file in gettok
This prevents an infinite loop. Change-Id: I7eda6b9d032ca0daeb24b555954330d07f35c78b
Diffstat (limited to 'src')
-rw-r--r--src/cmd/yacc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/yacc.c b/src/cmd/yacc.c
index 32698c2a..bd3f6aa4 100644
--- a/src/cmd/yacc.c
+++ b/src/cmd/yacc.c
@@ -1805,6 +1805,8 @@ begin:
}
} else
return c;
+ if(c == Beof)
+ return ENDFILE;
Bungetrune(finput);
}
tokname[i] = 0;