Commit 918ef3a7 authored by Bob Halley's avatar Bob Halley
Browse files

save options before doing DNS multiline mode

parent 1453fd8d
...@@ -75,8 +75,9 @@ ...@@ -75,8 +75,9 @@
/* /*
* The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in * The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in
* the DNS master file format. If this option is set, then the * the DNS master file format. If this option is set, then the
* ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored. * ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored when
* To use this option, '(' and ')' must be special characters. * the paren count is > 0. To use this option, '(' and ')' must be special
* characters.
*/ */
#define ISC_LEXOPT_DNSMULTILINE 0x20 /* Handle '(' and ')'. */ #define ISC_LEXOPT_DNSMULTILINE 0x20 /* Handle '(' and ')'. */
#define ISC_LEXOPT_NOMORE 0x40 /* Want "no more" token. */ #define ISC_LEXOPT_NOMORE 0x40 /* Want "no more" token. */
......
...@@ -300,7 +300,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { ...@@ -300,7 +300,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
char *curr, *prev; char *curr, *prev;
size_t remaining; size_t remaining;
u_long u_long; u_long u_long;
unsigned int i; unsigned int i, saved_options;
/* /*
* Get the next token. * Get the next token.
...@@ -338,12 +338,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { ...@@ -338,12 +338,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
return (ISC_R_EOF); return (ISC_R_EOF);
} }
if ((options & ISC_LEXOPT_DNSMULTILINE) != 0) { saved_options = options;
if (lex->paren_count > 0) if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && lex->paren_count > 0)
options &= ~IWSEOL; options &= ~IWSEOL;
else
options |= IWSEOL;
}
curr = lex->data; curr = lex->data;
prev = NULL; prev = NULL;
...@@ -450,7 +447,8 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { ...@@ -450,7 +447,8 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
return (ISC_R_UNBALANCED); return (ISC_R_UNBALANCED);
lex->paren_count--; lex->paren_count--;
if (lex->paren_count == 0) if (lex->paren_count == 0)
options |= IWSEOL; options =
saved_options;
} }
continue; continue;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment