From 96d6d277a453a602b9ec49131d8e332ce7aefcad Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Tue, 5 May 2020 14:32:12 -0400 Subject: caddyconfig: Don't start comments in middle of tokens (#3267) * caddyconfig: Only parse # as start of comment if preceded by space * caddyconfig: Simplify # logic using len(val), add a test --- caddyconfig/caddyfile/formatter.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'caddyconfig/caddyfile/formatter.go') diff --git a/caddyconfig/caddyfile/formatter.go b/caddyconfig/caddyfile/formatter.go index 2c97f3b..6270541 100644 --- a/caddyconfig/caddyfile/formatter.go +++ b/caddyconfig/caddyfile/formatter.go @@ -131,9 +131,6 @@ func Format(input []byte) []byte { ////////////////////////////////////////////////////////// if ch == '#' { - if !spacePrior && !beginningOfLine { - write(' ') - } comment = true } -- cgit v1.2.3