=================================================================== RCS file: /cvs/cvs/blind/parse.y,v retrieving revision 1.11 retrieving revision 1.12 diff -u -p -r1.11 -r1.12 --- blind/parse.y 2022/03/29 20:57:40 1.11 +++ blind/parse.y 2022/03/29 21:15:15 1.12 @@ -33,7 +33,6 @@ static struct file { u_char *ungetbuf; int eof_reached; int lineno; - int errors; } *f; int lookup(char *); @@ -84,7 +83,7 @@ typedef struct { grammar : | grammar '\n' | grammar set '\n' - | grammar error '\n' { f->errors++; } + | grammar error '\n' { errors++; } ; set : SET EXPIRE NUMBER { @@ -111,7 +110,7 @@ yyerror(const char *fmt, ...) va_list ap; char *msg; - f->errors++; + errors++; va_start(ap, fmt); if (vasprintf(&msg, fmt, ap) == -1) log_fatal("yyerror vasprintf"); @@ -198,7 +197,6 @@ lgetc(int quotec) if ((c = igetc()) == EOF) { yyerror("reached end of file while parsing " "quoted string"); - // if (file == top || config_pop() == EOF) if (config_pop() == EOF) return (EOF); return (quotec); @@ -227,7 +225,6 @@ lgetc(int quotec) return ('\n'); } while (c == EOF) { - //if (file == top || config_pop() == EOF) if (config_pop() == EOF) return (EOF); c = igetc(); @@ -444,8 +441,6 @@ config_load(struct blind *temp) } yyparse(); - errors = f->errors; - free(f); // setup @@ -503,6 +498,7 @@ config_pop(void) fclose(f->stream); free(f->name); free(f->ungetbuf); + free(f); return (EOF); }