diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1994-07-25 21:21:10 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1994-07-25 21:21:10 +0000 |
commit | 1a651d14c318823faf2a4742edfa2417b4e0bc67 (patch) | |
tree | 0e5f9cd544372ec40e6e59cf0542f30bbd0065be /gen.c | |
parent | f2938d67431dd108852261fe224541929d790b1b (diff) |
Bug fix for matching NUL's at end of token when interactive.
yy_flex_strcpy -> yy_flex_strncpy
Diffstat (limited to 'gen.c')
-rw-r--r-- | gen.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1048,7 +1048,8 @@ void make_tables() indent_puts( "YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" ); indent_down(); - indent_puts( "yy_flex_strcpy( yytext, yytext_ptr ); \\" ); + indent_puts( + "yy_flex_strncpy( yytext, yytext_ptr, yyleng ); \\" ); } set_indent( 0 ); @@ -1393,7 +1394,7 @@ void make_tables() /* Generate code for handling NUL's, if needed. */ /* First, deal with backing up and setting up yy_cp if the scanner - * finds that it should JAM on the NUL> + * finds that it should JAM on the NUL. */ skelout(); set_indent( 7 ); @@ -1412,6 +1413,13 @@ void make_tables() indent_puts( "yy_current_state = yy_last_accepting_state;" ); } + + else + /* Still need to initialize yy_cp, though + * yy_current_state was set up by + * yy_get_previous_state(). + */ + indent_puts( "yy_cp = yy_c_buf_p;" ); } |