commit - d3f073c9ede8d420b06fe8afe6fa8fa12c7b8185
commit + 002a84a1237d72a9e0ec824f05657a395469a38b
blob - 5c1d60c7572f4736c33ccc7a412ba5bf2390ba41
blob + 41fab03a93eb41ec5e8e41deed6da074dc8bdf5d
--- lex.l
+++ lex.l
\n yylineno++;
-[ \t]+ ;
+[ \f\r\t\v]+ ;
-. yyerror("unexpected character"); exit(1);
+. yyerror("unexpected character: %c", *yytext); exit(1);
%%
blob - 23a9225002b52fb4f71991afcc6d22ca016d9f5c
blob + 85bb1485d0593fe6dbdf35b1a5dd57b2b14f88b5
--- parse.y
+++ parse.y
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <err.h>
+#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
| TPREFORK TNUM { conf.prefork = check_prefork_num($2); }
| TPROTOCOLS TSTRING {
if (tls_config_parse_protocols(&conf.protos, $2) == -1)
- errx(1, "invalid protocols string \"%s\"", $2);
+ yyerror("invalid protocols string \"%s\"", $2);
}
| TUSER TSTRING { conf.user = $2; }
;
if (host->cert == NULL || host->key == NULL ||
host->dir == NULL)
- errx(1, "invalid vhost definition: %s", $2);
+ yyerror("invalid vhost definition: %s", $2);
if (++ihost == HOSTSLEN)
errx(1, "too much vhosts defined");
n = strtonum(p, 0, UINT16_MAX, &errstr);
if (errstr != NULL)
- errx(1, "port number is %s: %s", errstr, p);
+ yylineno("port number is %s: %s", errstr, p);
return n;
}
config_path = path;
if ((yyin = fopen(path, "r")) == NULL)
- fatal("cannot open config %s", path);
+ fatal("cannot open config: %s: %s", path, strerror(errno));
yyparse();
fclose(yyin);