better handle recursive includes
This commit is contained in:
parent
2718f6f23a
commit
01cb137157
6
zscan.go
6
zscan.go
|
@ -117,6 +117,9 @@ func parseZone(r io.Reader, f string, t chan Token, include int) {
|
|||
close(t)
|
||||
}
|
||||
}()
|
||||
if include > 7 {
|
||||
t <- Token{Error: &ParseError{f, "Too deeply nested $INCLUDE", l}}
|
||||
}
|
||||
var s scanner.Scanner
|
||||
c := make(chan lex)
|
||||
s.Init(r)
|
||||
|
@ -192,9 +195,6 @@ func parseZone(r io.Reader, f string, t chan Token, include int) {
|
|||
t <- Token{Error: &ParseError{f, "Failed to open `" + l.token + "'", l}}
|
||||
return
|
||||
}
|
||||
if include+1 > 8 {
|
||||
t <- Token{Error: &ParseError{f, "Too deeply nested $INCLUDE", l}}
|
||||
}
|
||||
parseZone(r1, l.token, t, include+1)
|
||||
st = _EXPECT_OWNER_DIR
|
||||
case _EXPECT_DIRTTL_BL:
|
||||
|
|
Loading…
Reference in New Issue