[comp.sources.bugs] previous flex reject bug patch

vern%lbl-pistachio@LBL-RTSG.ARPA (Vern Paxson) (05/07/88)

A note of warning: the patch I just posted included some extraneous diffs 
to "flex.skel" which will cause problems unless the -f/-F patch posted
earlier is present.  The "pure" reject patch is as follows.

		Vern


*** Release-1.0/distribution/flex.skel	Sun Apr 10 21:18:34 1988
--- flex.skel	Fri May  6 22:48:52 1988
***************
*** 28,33 ****
--- 28,36 ----
  YY_DECL
      {
      int yy_n_chars, yy_lp, yy_iii, yy_buf_pos, yy_act;
+ #ifdef FLEX_REJECT_ENABLED
+     int yy_full_match;
+ #endif
  
  %% user's declarations go here
  
***************
*** 41,46 ****
--- 44,55 ----
      goto get_next_token;
  
  do_action:
+ 
+ #ifdef FLEX_REJECT_ENABLED
+     /* remember matched text in case we back up due to trailing context */
+     yy_full_match = yy_c_buf_p;
+ #endif
+ 
      for ( ; ; )
  	{
  	YY_DO_BEFORE_ACTION
*** Release-1.0/distribution/flexskeldef.h	Sun Apr 10 21:07:36 1988
--- flexskeldef.h	Fri May  6 22:51:39 1988
***************
*** 33,38 ****
--- 33,39 ----
  #define REJECT \
          { \
          YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */ \
+         yy_c_buf_p = yy_full_match; /* restore possibly backed-over text */ \
          ++yy_lp; \
          goto find_rule; \
          }