]> granicus.if.org Git - sudo/commitdiff
when we get a syntax error, report it for the previous line since
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 20 Nov 1998 19:22:45 +0000 (19:22 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 20 Nov 1998 19:22:45 +0000 (19:22 +0000)
that's generally where the error occurred.

parse.yacc

index 4d11f6dc1e105845827ff8f5e3ef42656be6823e..3c939ec94ae8a05ade2ab584c58f054c9e8927c7 100644 (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