=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/doas/parse.y,v retrieving revision 1.13 retrieving revision 1.14 diff -c -r1.13 -r1.14 *** src/usr.bin/doas/parse.y 2015/11/27 21:10:17 1.13 --- src/usr.bin/doas/parse.y 2015/12/04 09:41:49 1.14 *************** *** 1,4 **** ! /* $OpenBSD: parse.y,v 1.13 2015/11/27 21:10:17 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst * --- 1,4 ---- ! /* $OpenBSD: parse.y,v 1.14 2015/12/04 09:41:49 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst * *************** *** 223,234 **** /* skip comments; NUL is allowed; no continuation */ while ((c = getc(yyfp)) != '\n') if (c == EOF) ! return 0; yylval.colno = 0; yylval.lineno++; return c; case EOF: ! return 0; } /* parsing next word */ --- 223,234 ---- /* skip comments; NUL is allowed; no continuation */ while ((c = getc(yyfp)) != '\n') if (c == EOF) ! goto eof; yylval.colno = 0; yylval.lineno++; return c; case EOF: ! goto eof; } /* parsing next word */ *************** *** 302,308 **** * the main loop. */ if (c == EOF) ! return 0; else if (qpos == -1) /* accept, e.g., empty args: cmd foo args "" */ goto repeat; } --- 302,308 ---- * the main loop. */ if (c == EOF) ! goto eof; else if (qpos == -1) /* accept, e.g., empty args: cmd foo args "" */ goto repeat; } *************** *** 316,319 **** --- 316,324 ---- err(1, "strdup"); yylval.str = str; return TSTRING; + + eof: + if (ferror(yyfp)) + yyerror("input error reading config"); + return 0; }