Allow for escape spaces in NewRR

Fix omission in NewRR where the parsing does not allow for
escaped spaces (unless \032 was used).
This commit is contained in:
Miek Gieben 2013-12-03 09:12:21 +00:00
parent 9b8e8578e4
commit 792fd9743e
2 changed files with 11 additions and 0 deletions

View File

@ -545,6 +545,11 @@ func TestParseBackslash(t *testing.T) {
} else {
t.Logf("Parsed %s\n", r.String())
}
if r, e := NewRR(`m\ @\ iek.nl. IN 3600 A 127.0.0.1`); e != nil {
t.Fatalf("Could not create RR with \\ and \\@ in it")
} else {
t.Logf("Parsed %s\n", r.String())
}
}
func TestILNP(t *testing.T) {

View File

@ -510,6 +510,12 @@ func zlexer(s *scan, c chan lex) {
switch x {
case ' ', '\t':
if escape {
escape = false
str[stri] = x
stri++
break
}
if quote {
// Inside quotes this is legal
str[stri] = x