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
This commit is contained in:
Francis Lavoie 2020-05-05 14:32:12 -04:00 committed by GitHub
parent 26e559662d
commit 96d6d277a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 6 deletions

View file

@ -131,9 +131,6 @@ func Format(input []byte) []byte {
//////////////////////////////////////////////////////////
if ch == '#' {
if !spacePrior && !beginningOfLine {
write(' ')
}
comment = true
}