aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2015-05-06 08:58:15 -0600
committerMatthew Holt <[email protected]>2015-05-06 08:58:15 -0600
commit63ccc626f9c292f5cea395645fea3376da58866b (patch)
tree70debb156bafd909c538a337b3c53bdf965122f1
parentb2549c317c03f7e8c15ed7e7d02d693711b03a20 (diff)
downloadcaddy-63ccc626f9c292f5cea395645fea3376da58866b.tar.gz
caddy-63ccc626f9c292f5cea395645fea3376da58866b.zip
Fix parsing bug for one-line Caddyfiles
-rw-r--r--config/parse/parsing.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/config/parse/parsing.go b/config/parse/parsing.go
index 430751107..8eb2c12c6 100644
--- a/config/parse/parsing.go
+++ b/config/parse/parsing.go
@@ -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