From fece54374d7824a2960346a98dfc7bc71d944e6f Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Mon, 13 Feb 2012 19:14:11 +0100 Subject: [PATCH] Support comments after $DIRECTIVEs Just read until the end of the line after the first string. --- zscan.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/zscan.go b/zscan.go index 449eadc4..85d13c48 100644 --- a/zscan.go +++ b/zscan.go @@ -197,6 +197,9 @@ func parseZone(r io.Reader, f string, t chan Token, include int) { t <- Token{Error: &ParseError{f, "Expecting $INCLUDE value, not this...", l}} return } + if e:=slurpRemainder(c, f) ; e != nil { + t <- Token{Error: e} + } // Start with the new file r1, e1 := os.Open(l.token) if e1 != nil { @@ -220,6 +223,9 @@ func parseZone(r io.Reader, f string, t chan Token, include int) { t <- Token{Error: &ParseError{f, "Expecting $TTL value, not this...", l}} return } + if e:=slurpRemainder(c, f) ; e != nil { + t <- Token{Error: e} + } if ttl, ok := stringToTtl(l, f, t); !ok { return } else { @@ -237,6 +243,9 @@ func parseZone(r io.Reader, f string, t chan Token, include int) { t <- Token{Error: &ParseError{f, "Expecting $ORIGIN value, not this...", l}} return } + if e:=slurpRemainder(c, f) ; e != nil { + t <- Token{Error: e} + } if !IsFqdn(l.token) { origin = l.token + "." + origin // Append old origin if the new one isn't a fqdn } else {