From 0078f5bc821ef49940675d81c4435812a4e92288 Mon Sep 17 00:00:00 2001 From: "shunevich.a" Date: Wed, 11 Jun 2025 16:31:37 +0300 Subject: [PATCH] prevent quotes duplication --- build.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.go b/build.go index 0544817c..b85e4cde 100644 --- a/build.go +++ b/build.go @@ -247,6 +247,12 @@ func needsQuote(s string) bool { return true } + // if the string starts and ends with quotes, it is already quoted + if strings.HasPrefix(s, "\"") && strings.HasSuffix(s, "\"") || + strings.HasPrefix(s, "'") && strings.HasSuffix(s, "'") { + return false + } + // lexer should throw an error when variable expansion syntax // is messed up, but just wrap it in quotes for now I guess var char rune