From 42d9ff5a49e35174f7edbed66e82415dd63b36e9 Mon Sep 17 00:00:00 2001 From: David Leonard Date: Sun, 12 Dec 1999 15:08:15 +0000 Subject: better error msg. hook to parse command line options. reviewed by pjanzen@ --- games/hunt/huntd/conf.c | 16 ++++++++++++++-- games/hunt/huntd/conf.h | 4 +++- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'games/hunt') diff --git a/games/hunt/huntd/conf.c b/games/hunt/huntd/conf.c index 20e85326cdf..d3db9ae99e3 100644 --- a/games/hunt/huntd/conf.c +++ b/games/hunt/huntd/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.3 1999/08/30 23:35:50 d Exp $ */ +/* $OpenBSD: conf.c,v 1.4 1999/12/12 15:08:14 d Exp $ */ /* David Leonard , 1999. Public domain. */ #include @@ -231,7 +231,7 @@ parse_line(buf, fnm, line) p++; if (*p++ != '=') { - logx(LOG_ERR, "%s:%d: expected `='", fnm, *line); + logx(LOG_ERR, "%s:%d: expected `=' after %s", fnm, *line, word); return; } @@ -312,3 +312,15 @@ config() log(LOG_WARNING, "%s", nm); } } + +/* + * Parse a single configuration argument given on the command line + */ +void +config_arg(arg) + char *arg; +{ + int line = 0; + + parse_line(arg, "*Initialisation*", &line); +} diff --git a/games/hunt/huntd/conf.h b/games/hunt/huntd/conf.h index fb88e07acb0..63bd83301c4 100644 --- a/games/hunt/huntd/conf.h +++ b/games/hunt/huntd/conf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.h,v 1.2 1999/02/01 06:53:55 d Exp $ */ +/* $OpenBSD: conf.h,v 1.3 1999/12/12 15:08:14 d Exp $ */ /* Configuration option variables for the server: */ @@ -51,3 +51,5 @@ extern int conf_mindshot; extern int conf_simstep; void config __P((void)); +void config_arg __P((char *)); + -- cgit v1.2.3