Skip to content

Commit

Permalink
compare tokens from copies when importing
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Jul 12, 2023
1 parent 768b191 commit ea8ea94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caddyconfig/caddyfile/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func (p *parser) doImport(nesting int) error {
// format, won't check for nesting correctness or any other error, that's what parser does.
if !maybeSnippet && nesting == 0 {
// first of the line
if i == 0 || isNextOnNewLine(importedTokens[i-1], token) {
if i == 0 || isNextOnNewLine(tokensCopy[i-1], token) {
index = 0
} else {
index++
Expand Down

0 comments on commit ea8ea94

Please sign in to comment.