From: Michal 'vorner' Vaner Date: Tue, 11 Dec 2012 18:54:12 +0000 (+0100) Subject: [2428] Placeholder for origin handling X-Git-Tag: bind10-1.0.0-beta-release~24^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=320f960c727b5785a1869fc2e9898fea6b9e14fd;p=thirdparty%2Fkea.git [2428] Placeholder for origin handling The $INCLUDE can contain a name meaning origin. We don't handle origin yet, that's #2427, but we at least mark the place where it should be linked. --- diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc index e73ccee615..1f7b7d67d1 100644 --- a/src/lib/dns/master_loader.cc +++ b/src/lib/dns/master_loader.cc @@ -117,15 +117,29 @@ public: void doInclude() { // First, get the filename to include const MasterToken::StringRegion - filename(lexer_.getNextToken(MasterToken::QSTRING). - getStringRegion()); - - // TODO: Handle Origin + filename_tok(lexer_.getNextToken(MasterToken::QSTRING). + getStringRegion()); // Push the filename. We abuse the fact that filename // may not contain '\0' anywhere in it, so we can // freely use the filename.beg directly. - pushSource(filename.beg); + string filename(filename_tok.beg); + + // There could be an origin (or maybe not). So try looking + const MasterToken name_tok(lexer_.getNextToken(MasterToken::QSTRING, + true)); + + if (name_tok.getType() == MasterToken::QSTRING || + name_tok.getType() == MasterToken::STRING) { + // TODO: Handle the origin. Once we complete #2427. + } else { + // We return the newline there. This is because after we pop + // the source, we want to call eatUntilEOL and this would + // eat to the next one. + lexer_.ungetToken(); + } + + pushSource(filename); } void handleDirective(const char* directive, size_t length) {