From 0d437e25de7d14dc780fd152e86e0414a027a2f5 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Wed, 6 Aug 2014 17:50:28 -0500 Subject: Better error msg for bad shell quoting (fix #538) --- parser.y | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'parser.y') diff --git a/parser.y b/parser.y index 72e2b28f..7117b4ca 100644 --- a/parser.y +++ b/parser.y @@ -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, -- cgit v1.2.3