opendoas

A portable version of the OpenBSD `doas` command
git clone https://pi.duncano.de/git/opendoas.git
Log | Files | Refs | README | LICENSE

commit 5fe12316b511d8392db3bdf9c8a4ac836bd85493
parent 135b26bc13338163773b613e459bdac850927ae9
Author: Nicholas Marriott <nicm@openbsd.org>
Date:   Thu, 16 Jul 2015 23:02:56 +0000

Prototype yy* functions, and use verrx in yyerror(). ok tedu

Diffstat:
parse.y | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 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 {