mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
1859. [func] Add support for CH A record. [RT #14695]
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: lex.c,v 1.81 2005/04/29 00:23:27 marka Exp $ */
|
||||
/* $Id: lex.c,v 1.82 2005/06/04 00:18:55 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
@@ -565,7 +565,11 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
|
||||
} else if (isdigit((unsigned char)c) &&
|
||||
(options & ISC_LEXOPT_NUMBER) != 0) {
|
||||
lex->last_was_eol = ISC_FALSE;
|
||||
state = lexstate_number;
|
||||
if ((options & ISC_LEXOPT_OCTAL) != 0 &&
|
||||
(c == '8' || c == '9'))
|
||||
state = lexstate_string;
|
||||
else
|
||||
state = lexstate_number;
|
||||
goto no_read;
|
||||
} else {
|
||||
lex->last_was_eol = ISC_FALSE;
|
||||
@@ -586,7 +590,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
|
||||
c == '\n' || c == EOF ||
|
||||
lex->specials[c]) {
|
||||
int base;
|
||||
if ((options & ISC_LEXOPT_CNUMBER) != 0)
|
||||
if ((options & ISC_LEXOPT_OCTAL) != 0)
|
||||
base = 8;
|
||||
else if ((options & ISC_LEXOPT_CNUMBER) != 0)
|
||||
base = 0;
|
||||
else
|
||||
base = 10;
|
||||
@@ -621,6 +627,9 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
|
||||
(lex->data[0] != '0'))) {
|
||||
/* Above test supports hex numbers */
|
||||
state = lexstate_string;
|
||||
} else if ((options & ISC_LEXOPT_OCTAL) != 0 &&
|
||||
(c == '8' || c == '9')) {
|
||||
state = lexstate_string;
|
||||
}
|
||||
}
|
||||
if (remaining == 0U) {
|
||||
@@ -819,6 +828,33 @@ isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token,
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, isc_boolean_t eol)
|
||||
{
|
||||
unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF |
|
||||
ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE|
|
||||
ISC_LEXOPT_NUMBER | ISC_LEXOPT_OCTAL;
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_lex_gettoken(lex, options, token);
|
||||
if (result == ISC_R_RANGE)
|
||||
isc_lex_ungettoken(lex, token);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
if (eol && ((token->type == isc_tokentype_eol) ||
|
||||
(token->type == isc_tokentype_eof)))
|
||||
return (ISC_R_SUCCESS);
|
||||
if (token->type != isc_tokentype_number) {
|
||||
isc_lex_ungettoken(lex, token);
|
||||
if (token->type == isc_tokentype_eol ||
|
||||
token->type == isc_tokentype_eof)
|
||||
return (ISC_R_UNEXPECTEDEND);
|
||||
return (ISC_R_BADNUMBER);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
void
|
||||
isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) {
|
||||
inputsource *source;
|
||||
|
Reference in New Issue
Block a user