to the same thing. This is important for flex since we are
doing a YY_NEWFILE
* for parse errors.
*/
yyout = stdout;
- yyin = fopen(stmp, "r");
+ if (parse_error)
+ yyin = freopen(stmp, "r", yyin);
+ else
+ yyin = fopen(stmp, "r");
if (yyin == NULL) {
(void) fprintf(stderr,
"%s: Can't re-open temporary file (%s), %s unchanged.\n",
Argv[0], stmp, sudoers);
Exit(1);
}
-
- (void) fclose(yyin);
} else {
(void) fprintf(stderr, "%s: Editor (%s) failed, %s unchanged.\n",
Argv[0], Editor, sudoers);