commit e3e30cff40da4c3d1c6ea56ed1cd0e136fb655c9 from: rsc date: Tue Aug 17 15:30:36 2004 UTC Fix huge bug in lex, introduced by porting. Surprising that anything worked. commit - d16cfe2431bc5e31128adf0d577a3483a89f8f82 commit + e3e30cff40da4c3d1c6ea56ed1cd0e136fb655c9 blob - 53345beb1e2faee4934ef2fc6e693e9727482638 blob + 8b1ba5f098d23e1eee813f6e1e9c43599347f0d8 --- src/cmd/lex/header.c +++ src/cmd/lex/header.c @@ -84,8 +84,8 @@ phead1(void) void phead2(void) { - Bprint(&fout,"while((nstr = yylook()) >= 0)\n"); - Bprint(&fout,"goto yyfussy;\nyyfussy: switch(nstr){\n"); + Bprint(&fout,"while((nstr = yylook()) >= 0){\n"); + Bprint(&fout,"goto yyfussy; yyfussy: switch(nstr){\n"); Bprint(&fout,"case 0:\n"); Bprint(&fout,"if(yywrap()) return(0); break;\n"); } @@ -97,7 +97,7 @@ ptail(void) Bprint(&fout,"case -1:\nbreak;\n"); /* for reject */ Bprint(&fout,"default:\n"); Bprint(&fout,"fprintf(yyout,\"bad switch yylook %%d\",nstr);\n"); - Bprint(&fout,"} return(0); }\n"); + Bprint(&fout,"}} return(0); }\n"); Bprint(&fout,"/* end of yylex */\n"); } pflag = 1;