Commit d1e971ba authored by Mark Andrews's avatar Mark Andrews
Browse files

316. [bug] EOF mid line should be a error.

 315.   [bug]           Handle non-empty blanks lines.
parent ddc12c61
316. [bug] EOF mid line should be a error.
315. [bug] Handle non-empty blanks lines.
314. [func] Inet controls named.conf statement can now have
any non-negative number of keys specified.
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: master.c,v 1.55 2000/06/29 15:55:19 marka Exp $ */
/* $Id: master.c,v 1.56 2000/07/09 12:52:34 marka Exp $ */
#include <config.h>
......@@ -186,6 +186,7 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
isc_boolean_t finish_origin = ISC_FALSE;
isc_boolean_t finish_include = ISC_FALSE;
isc_boolean_t read_till_eol = ISC_FALSE;
isc_boolean_t initialws;
char *include_file = NULL;
isc_token_t token;
isc_result_t result = ISC_R_UNEXPECTED;
......@@ -253,9 +254,18 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
memset(name_in_use, 0, NBUFS * sizeof(isc_boolean_t));
do {
initialws = ISC_FALSE;
GETTOKEN(lex, ISC_LEXOPT_INITIALWS, &token, ISC_TRUE);
if (token.type == isc_tokentype_eof) {
if (read_till_eol) {
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu: unexpected end of file",
isc_lex_getsourcename(lex),
isc_lex_getsourceline(lex));
result = ISC_R_UNEXPECTEDEND;
goto cleanup;
}
done = ISC_TRUE;
continue;
}
......@@ -269,18 +279,10 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
continue;
if (token.type == isc_tokentype_initialws) {
if (!current_known) {
(*callbacks->error)(callbacks,
"%s: %s:%lu: No current owner name",
"dns_master_load",
isc_lex_getsourcename(lex),
isc_lex_getsourceline(lex));
result = DNS_R_NOOWNER;
goto cleanup;
}
/*
* Still working on the same name.
*/
initialws = ISC_TRUE;
} else if (token.type == isc_tokentype_string) {
/*
......@@ -545,7 +547,33 @@ load(isc_lex_t *lex, dns_name_t *top, dns_name_t *origin,
type = 0;
rdclass = 0;
GETTOKEN(lex, 0, &token, ISC_FALSE);
GETTOKEN(lex, 0, &token, initialws);
if (initialws) {
if (token.type == isc_tokentype_eol) {
read_till_eol = ISC_FALSE;
continue; /* blank line */
}
if (token.type == isc_tokentype_eof) {
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu: unexpected end of file",
isc_lex_getsourcename(lex),
isc_lex_getsourceline(lex));
result = ISC_R_UNEXPECTEDEND;
goto cleanup;
}
if (!current_known) {
(*callbacks->error)(callbacks,
"%s: %s:%lu: No current owner name",
"dns_master_load",
isc_lex_getsourcename(lex),
isc_lex_getsourceline(lex));
result = DNS_R_NOOWNER;
goto cleanup;
}
}
if (dns_rdataclass_fromtext(&rdclass,
&token.value.as_textregion)
......
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