mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-02 23:35:36 +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:
@@ -147,9 +147,10 @@ void yyerror(s)
|
|||||||
{
|
{
|
||||||
/* save the line the first error occured on */
|
/* save the line the first error occured on */
|
||||||
if (errorlineno == -1)
|
if (errorlineno == -1)
|
||||||
errorlineno = sudolineno;
|
errorlineno = sudolineno - 1;
|
||||||
#ifndef TRACELEXER
|
#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
|
#else
|
||||||
(void) fprintf(stderr, "<*> ");
|
(void) fprintf(stderr, "<*> ");
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user