From: Ted Lemon Date: Thu, 23 May 1996 22:21:12 +0000 (+0000) Subject: Add tlname variable to store pointer to name of file being parsed X-Git-Tag: BETA_4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee9d710a5a699dc7dc9febfa3f4ca883380ae4f2;p=thirdparty%2Fdhcp.git Add tlname variable to store pointer to name of file being parsed --- diff --git a/common/conflex.c b/common/conflex.c index 461c21697..06c54fc38 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -53,6 +53,7 @@ static int line; static int lpos; int tlpos; int tline; +char *tlname; static int token; static int ugflag; static char *tval; diff --git a/common/errwarn.c b/common/errwarn.c index 89752d03c..779c92afb 100644 --- a/common/errwarn.c +++ b/common/errwarn.c @@ -183,15 +183,14 @@ int parse_warn (ANSI_DECL (char *) fmt, VA_DOTDOTDOT) KandR (char *fmt;) va_dcl { - extern int tline, tlpos; va_list list; do_percentm (mbuf, fmt); #ifndef NO_SNPRINTF - snprintf (fbuf, sizeof fbuf, "dhcpd.conf line %d char %d: %s", - tline, tlpos, mbuf); + snprintf (fbuf, sizeof fbuf, "%s line %d char %d: %s", + tlname, tline, tlpos, mbuf); #else - sprintf (fbuf, "dhcpd.conf line %d char %d: %s", tline, tlpos, mbuf); + sprintf (fbuf, "%s line %d char %d: %s", tlname, tline, tlpos, mbuf); #endif VA_start (list, fmt); diff --git a/conflex.c b/conflex.c index 461c21697..06c54fc38 100644 --- a/conflex.c +++ b/conflex.c @@ -53,6 +53,7 @@ static int line; static int lpos; int tlpos; int tline; +char *tlname; static int token; static int ugflag; static char *tval; diff --git a/dhcpd.h b/dhcpd.h index 7545a6e22..9c586030f 100644 --- a/dhcpd.h +++ b/dhcpd.h @@ -266,6 +266,8 @@ int main PROTO ((int, char **, char **)); void cleanup PROTO ((void)); /* conflex.c */ +extern int tline, tlpos; +extern char *tlname; int next_token PROTO ((char **, FILE *)); int peek_token PROTO ((char **, FILE *)); diff --git a/errwarn.c b/errwarn.c index 89752d03c..779c92afb 100644 --- a/errwarn.c +++ b/errwarn.c @@ -183,15 +183,14 @@ int parse_warn (ANSI_DECL (char *) fmt, VA_DOTDOTDOT) KandR (char *fmt;) va_dcl { - extern int tline, tlpos; va_list list; do_percentm (mbuf, fmt); #ifndef NO_SNPRINTF - snprintf (fbuf, sizeof fbuf, "dhcpd.conf line %d char %d: %s", - tline, tlpos, mbuf); + snprintf (fbuf, sizeof fbuf, "%s line %d char %d: %s", + tlname, tline, tlpos, mbuf); #else - sprintf (fbuf, "dhcpd.conf line %d char %d: %s", tline, tlpos, mbuf); + sprintf (fbuf, "%s line %d char %d: %s", tlname, tline, tlpos, mbuf); #endif VA_start (list, fmt); diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 7545a6e22..9c586030f 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -266,6 +266,8 @@ int main PROTO ((int, char **, char **)); void cleanup PROTO ((void)); /* conflex.c */ +extern int tline, tlpos; +extern char *tlname; int next_token PROTO ((char **, FILE *)); int peek_token PROTO ((char **, FILE *));