pc(1): _ handling in numbers was broken at some point; restore documented behaviour

This commit is contained in:
aiju 2016-09-15 09:13:22 +00:00
parent 07284c41f6
commit 0c3ba556a2

View file

@ -527,7 +527,7 @@ yylex(void)
if(c == '\n') prompted = 0;
if(isdigit(c)){
for(p = buf, *p++ = c; c = Bgetc(in), isalnum(c) || c == '_'; )
if(p < buf + sizeof(buf) - 1)
if(p < buf + sizeof(buf) - 1 && c != '_')
*p++ = c;
*p = 0;
Bungetc(in);