Fix escpaping in labels
This commit is contained in:
parent
530fa18e70
commit
99d2040a29
|
@ -7,10 +7,15 @@ func SplitLabels(s string) []string {
|
||||||
last := byte('.')
|
last := byte('.')
|
||||||
k := 0
|
k := 0
|
||||||
labels := make([]string, 0)
|
labels := make([]string, 0)
|
||||||
|
escape := false
|
||||||
s = Fqdn(s) // Make fully qualified
|
s = Fqdn(s) // Make fully qualified
|
||||||
for i := 0; i < len(s); i++ {
|
for i := 0; i < len(s); i++ {
|
||||||
|
escape = false
|
||||||
|
if s[i] == '\\' {
|
||||||
|
escape = true
|
||||||
|
}
|
||||||
if s[i] == '.' {
|
if s[i] == '.' {
|
||||||
if last == '\\' {
|
if last == '\\' && !escape {
|
||||||
// do nothing
|
// do nothing
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue