2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

when we get a syntax error, report it for the previous line since

that's generally where the error occurred.
This commit is contained in:
Todd C. Miller
1998-11-20 19:22:45 +00:00
parent 6bf40c3c0d
commit cbd9d6f32d

View File

@@ -147,9 +147,10 @@ void yyerror(s)
{
/* save the line the first error occured on */
if (errorlineno == -1)
errorlineno = sudolineno;
errorlineno = sudolineno - 1;
#ifndef TRACELEXER
(void) fprintf(stderr, ">>> sudoers file: %s, line %d <<<\n", s, sudolineno);
(void) fprintf(stderr, ">>> sudoers file: %s, line %d <<<\n", s,
sudolineno - 1);
#else
(void) fprintf(stderr, "<*> ");
#endif