2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 15:45:25 +00:00

fix paren handling in quoted strings again.

This commit is contained in:
Brian Wellington
2000-11-18 01:02:39 +00:00
parent 8bba70c48d
commit 6a9f7f6e51

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: lex.c,v 1.49 2000/11/18 00:54:19 bwelling Exp $ */ /* $Id: lex.c,v 1.50 2000/11/18 01:02:39 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -335,7 +335,9 @@ unpushback(inputsource *source) {
} }
static isc_result_t static isc_result_t
pushandgrow(isc_lex_t *lex, inputsource *source, int c, unsigned int options) { pushandgrow(isc_lex_t *lex, inputsource *source, int c, unsigned int options,
lexstate state)
{
if (isc_buffer_availablelength(source->pushback) == 0) { if (isc_buffer_availablelength(source->pushback) == 0) {
isc_buffer_t *tbuf = NULL; isc_buffer_t *tbuf = NULL;
unsigned int oldlen; unsigned int oldlen;
@@ -353,10 +355,14 @@ pushandgrow(isc_lex_t *lex, inputsource *source, int c, unsigned int options) {
source->pushback = tbuf; source->pushback = tbuf;
} }
isc_buffer_putuint8(source->pushback, (isc_uint8_t)c); isc_buffer_putuint8(source->pushback, (isc_uint8_t)c);
if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && c == '(') if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 &&
state == lexstate_start)
{
if (c == '(')
source->pushback_parens++; source->pushback_parens++;
if ((options & ISC_LEXOPT_DNSMULTILINE) != 0 && c == ')') else if (c == ')')
source->pushback_parens--; source->pushback_parens--;
}
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
@@ -451,7 +457,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
} }
if (c != EOF) { if (c != EOF) {
source->result = pushandgrow(lex, source, c, source->result = pushandgrow(lex, source, c,
options); options, state);
if (source->result != ISC_R_SUCCESS) if (source->result != ISC_R_SUCCESS)
return (source->result); return (source->result);
} }