Suppress corrupt error output from dbStatic parser
The yyerror() routine gets called twice in some cases. Don't print the yytext or input file location the second time through -- yytext has already been freed, and the user doesn't need to see the location twice. Fixes lp:1422803
This commit is contained in:
@@ -266,12 +266,14 @@ alias: tokenALIAS '(' tokenSTRING ',' tokenSTRING ')'
|
||||
static int yyerror(char *str)
|
||||
{
|
||||
if (str)
|
||||
epicsPrintf("Error: %s\n ", str);
|
||||
epicsPrintf("Error: %s\n", str);
|
||||
else
|
||||
epicsPrintf("Error");
|
||||
epicsPrintf(" at or before \"%s\"", yytext);
|
||||
dbIncludePrint();
|
||||
yyFailed = TRUE;
|
||||
if (!yyFailed) { /* Only print this stuff once */
|
||||
epicsPrintf(" at or before \"%s\"", yytext);
|
||||
dbIncludePrint();
|
||||
yyFailed = TRUE;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
static long pvt_yy_parse(void)
|
||||
|
||||
Reference in New Issue
Block a user