Fix parsing bug for one-line Caddyfiles

This commit is contained in:
Matthew Holt 2015-05-06 08:58:15 -06:00
parent b2549c317c
commit 63ccc626f9

View file

@ -51,6 +51,12 @@ func (p *parser) begin() error {
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()
if err != nil {
return err
@ -113,12 +119,6 @@ func (p *parser) blockContents() error {
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()
if err != nil {
return err