mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Add tlname variable to store pointer to name of file being parsed
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
2
dhcpd.h
2
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 *));
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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 *));
|
||||
|
||||
|
Reference in New Issue
Block a user