\r
/* Parse a move from the given string s */\r
/* ^ at start of pattern WON'T work here unless using flex */\r
-ChessMove yylexstr(boardIndex, s)\r
- int boardIndex;\r
- char *s;\r
-{\r
+ChessMove yylexstr(boardIndex, s, text, len)\r
+ int boardIndex, len;\r
+ char *s, *text;\r
+{
ChessMove ret;\r
char *oldStringToLex;\r
#ifdef FLEX_SCANNER\r
yy_switch_to_buffer(buffer);\r
#endif /*FLEX_SCANNER*/\r
\r
- ret = (ChessMove) yylex();\r
+ ret = (ChessMove) yylex();
+ strncpy(text, yy_text, len-1); // [HGM] vari: yy_text is not available to caller after buffer switch ?!?
+ text[len-1] = NULLCHAR;\r
\r
#ifdef FLEX_SCANNER\r
if (oldBuffer != NULL) \r