Fix empty name in config block directive
This commit is contained in:
parent
8d2b9202b5
commit
728c5fcf17
|
@ -82,7 +82,14 @@ func Parse(r io.Reader) (*Directive, error) {
|
||||||
var d *Directive
|
var d *Directive
|
||||||
if words[len(words)-1] == "{" && l[len(l)-1] == '{' {
|
if words[len(words)-1] == "{" && l[len(l)-1] == '{' {
|
||||||
words = words[:len(words)-1]
|
words = words[:len(words)-1]
|
||||||
d = &Directive{Params: words}
|
|
||||||
|
var name string
|
||||||
|
params := words
|
||||||
|
if len(words) > 0 {
|
||||||
|
name, params = words[0], words[1:]
|
||||||
|
}
|
||||||
|
|
||||||
|
d = &Directive{Name: name, Params: params}
|
||||||
cur = d
|
cur = d
|
||||||
directives = append(directives, d)
|
directives = append(directives, d)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue