mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-01 00:23:48 +03:00
Fix parsing bug for one-line Caddyfiles
This commit is contained in:
parent
b2549c317c
commit
63ccc626f9
1 changed files with 6 additions and 6 deletions
|
@ -51,6 +51,12 @@ func (p *parser) begin() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.eof {
|
||||||
|
// this happens if the Caddyfile consists of only
|
||||||
|
// a line of addresses and nothing else
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
err = p.blockContents()
|
err = p.blockContents()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -113,12 +119,6 @@ func (p *parser) blockContents() error {
|
||||||
p.cursor--
|
p.cursor--
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.eof {
|
|
||||||
// this happens if the Caddyfile consists of only
|
|
||||||
// a line of addresses and nothing else
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
err := p.directives()
|
err := p.directives()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue