Better error msg for bad shell quoting (fix #538)

This commit is contained in:
Nicolas Williams committed 2014-08-06 17:51:53 -05:00
1 parent 6744664ff4
commit 0d437e25de
1 file changed
+9 -1
+9 -1
View File
@@ -118,7 +118,15 @@ struct lexer_param {
void yyerror(YYLTYPE* loc, block* answer, int* errors,
struct locfile* locations, struct lexer_param* lexer_param_ptr, const char *s){
(*errors)++;
locfile_locate(locations, *loc, "error: %s", s);
if (strstr(s, "unexpected")) {
#ifdef WIN32
locfile_locate(locations, *loc, "error: %s (Windows cmd shell quoting issues?)", s);
#else
locfile_locate(locations, *loc, "error: %s (Unix shell quoting issues?)", s);
#endif
} else {
locfile_locate(locations, *loc, "error: %s", s);
}
}
int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors,