2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-05 08:45:35 +00:00

Fix ugly output on config errors.

See RT ticket #17011 for more.
This commit is contained in:
Shane Kerr
2007-08-29 15:56:56 +00:00
parent f800f4f633
commit d19e816ece
2 changed files with 33 additions and 12 deletions

View File

@@ -254,6 +254,23 @@ struct parse {
const char *tlname;
int eol_token;
/*
* In order to give nice output when we have a parsing error
* in our file, we keep track of where we are in the line so
* that we can show the user.
*
* We need to keep track of two lines, because we can look
* ahead, via the "peek" function, to the next line sometimes.
*
* The "line1" and "line2" variables act as buffers for this
* information. The "lpos" variable tells us where we are in the
* line.
*
* When we "put back" a character from the parsing context, we
* do not want to have the character appear twice in the error
* output. So, we set a flag, the "ugflag", which the
* get_char() function uses to check for this condition.
*/
char line1 [81];
char line2 [81];
int lpos;