[net.bugs] lex right context bug

ptw@encore.UUCP (P. Tucker Withington) (01/08/85)

Index: lex 4.1 8/11/83 (BSD); 1.4 ? (Sys. V)

The following fragment appears to raise a bug in lex.  When the *-ed expression
matches 0 characters (e.g., & is the first input), yytext comes back as "&"
rather than "".  I am able to work around with a judicious REJECT, but I don't
think I should have to.  Any opinions or ideas?  Am I missing something?


name	[0-9A-Za-z.\-]

%%

{name}*/&       {
         if(yytext[0] == '&')
          printf("Bug!\n");
	}


                               o.o      --tucker
                                ~