From ea8ea94ee2cd25d8407ce992b50b47f36285f351 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Wed, 12 Jul 2023 11:22:59 +0800 Subject: [PATCH] compare tokens from copies when importing --- caddyconfig/caddyfile/parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caddyconfig/caddyfile/parse.go b/caddyconfig/caddyfile/parse.go index 66fbd244c5d..0a1a9e7b16f 100644 --- a/caddyconfig/caddyfile/parse.go +++ b/caddyconfig/caddyfile/parse.go @@ -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++