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

@ -141,7 +141,7 @@ func (l *lexer) next() bool {
continue
}
if ch == '#' {
if ch == '#' && len(val) == 0 {
comment = true
}
if comment {