From: claudio Date: Fri, 21 Sep 2018 08:15:33 +0000 (+0000) Subject: better yyerror messages. "syntax error" is generally not very helpful. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=946ac95c8d20d16a850e74f16af8d739d14b69b5;p=openbsd better yyerror messages. "syntax error" is generally not very helpful. OK denis@ --- diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 66847b8a451..66d5a3a4a94 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.357 2018/09/21 05:13:35 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.358 2018/09/21 08:15:33 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -1405,7 +1405,7 @@ peeropts : REMOTEAS as4number { curpeer->conf.export_type = EXPORT_DEFAULT_ROUTE; } else { - yyerror("syntax error"); + yyerror("syntax error: unknown '%s'", $2); free($2); YYERROR; } @@ -2194,7 +2194,7 @@ filter_elm : filter_prefix_h { YYERROR; } if (fmopts.m.prefixset.name[0] != '\0') { - yyerror("prefix-set filters already specified"); + yyerror("prefix-set filter already specified"); free($2); YYERROR; } @@ -3023,7 +3023,7 @@ top: *p = '\0'; break; } else if (c == '\0') { - yyerror("syntax error"); + yyerror("syntax error: unterminated quote"); return (findeol()); } if (p + 1 >= buf + sizeof(buf) - 1) {