=================================================================== RCS file: /cvs/cvs/blind/parse.y,v retrieving revision 1.11 retrieving revision 1.13 diff -u -p -r1.11 -r1.13 --- blind/parse.y 2022/03/29 20:57:40 1.11 +++ blind/parse.y 2022/03/29 21:23:50 1.13 @@ -25,17 +25,6 @@ #include "config.h" #include "log.h" -static struct file { - FILE *stream; - char *name; - size_t ungetpos; - size_t ungetsize; - u_char *ungetbuf; - int eof_reached; - int lineno; - int errors; -} *f; - int lookup(char *); int igetc(void); int lgetc(int); @@ -84,7 +73,7 @@ typedef struct { grammar : | grammar '\n' | grammar set '\n' - | grammar error '\n' { f->errors++; } + | grammar error '\n' { errors++; } ; set : SET EXPIRE NUMBER { @@ -111,7 +100,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 +187,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 +215,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 +431,6 @@ config_load(struct blind *temp) } yyparse(); - errors = f->errors; - free(f); // setup @@ -503,6 +488,7 @@ config_pop(void) fclose(f->stream); free(f->name); free(f->ungetbuf); + free(f); return (EOF); }