]> git.armaanb.net Git - opendoas.git/commitdiff
Prototype yy* functions, and use verrx in yyerror(). ok tedu
authorNicholas Marriott <nicm@openbsd.org>
Thu, 16 Jul 2015 23:02:56 +0000 (23:02 +0000)
committerNicholas Marriott <nicm@openbsd.org>
Thu, 16 Jul 2015 23:02:56 +0000 (23:02 +0000)
parse.y

diff --git a/parse.y b/parse.y
index d35f38688ec65e6718f86648fe6b2e3621c0fa6b..4e158783ac85e7ab7210791cc1d14e53f8120955 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.2 2015/07/16 22:11:01 nicm Exp $ */
+/* $OpenBSD: parse.y,v 1.3 2015/07/16 22:33:01 zhuk Exp $ */
 /*
  * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
  *
@@ -44,6 +44,10 @@ FILE *yyfp;
 struct rule **rules;
 int nrules, maxrules;
 
+void yyerror(const char *, ...);
+int yylex(void);
+int yyparse(void);
+
 %}
 
 %token TPERMIT TDENY TAS TCMD
@@ -143,11 +147,7 @@ yyerror(const char *fmt, ...)
        va_list va;
 
        va_start(va, fmt);
-       fprintf(stderr, "doas: ");
-       vfprintf(stderr, fmt, va);
-       fprintf(stderr, "\n");
-       va_end(va);
-       exit(1);
+       verrx(1, fmt, va);
 }
 
 struct keyword {