summaryrefslogtreecommitdiff
path: root/gen.c
diff options
context:
space:
mode:
authorvern <vern>1994-07-25 21:21:10 +0000
committervern <vern>1994-07-25 21:21:10 +0000
commit3e5d826c3dbc46b6bd16d8441d8da1d329354f6a (patch)
treed5b9dbc52c477bc5d9277c3ead9c42318427ef85 /gen.c
parentcedff61676952a8a2c219c58932bf1e2f4439a46 (diff)
downloadflex-3e5d826c3dbc46b6bd16d8441d8da1d329354f6a.tar.gz
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.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gen.c b/gen.c
index 8a32619..5d6907f 100644
--- a/gen.c
+++ b/gen.c
@@ -26,7 +26,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-/* $Header: /cvsroot/flex/flex/gen.c,v 2.38 1993/12/11 17:06:36 vern Exp $ */
+/* $Header: /cvsroot/flex/flex/gen.c,v 2.39 1994/07/25 21:21:10 vern Exp $ */
#include "flexdef.h"
@@ -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;" );
}