1
1
mirror of https://git.sr.ht/~emersion/tlstunnel synced 2024-11-19 15:53:50 +01:00

Fix empty name in config block directive

This commit is contained in:
Simon Ser 2020-09-09 13:05:00 +02:00
parent 8d2b9202b5
commit 728c5fcf17
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

@ -82,7 +82,14 @@ func Parse(r io.Reader) (*Directive, error) {
var d *Directive
if words[len(words)-1] == "{" && l[len(l)-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
directives = append(directives, d)
} else {