tFix huge bug in lex, introduced by porting. Surprising that anything worked. - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit e3e30cff40da4c3d1c6ea56ed1cd0e136fb655c9
parent d16cfe2431bc5e31128adf0d577a3483a89f8f82
Author: rsc 
Date:   Tue, 17 Aug 2004 15:30:36 +0000

Fix huge bug in lex, introduced by porting.
Surprising that anything worked.

Diffstat:
  M src/cmd/lex/header.c                |       6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/cmd/lex/header.c b/src/cmd/lex/header.c
t@@ -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");
 }
t@@ -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;