From 16c71e63843a467c16531afd5f39803c19388a8e Mon Sep 17 00:00:00 2001 From: krau <71133316+krau@users.noreply.github.com> Date: Sun, 9 Nov 2025 11:48:15 +0800 Subject: [PATCH] fix: enhance ParseArgsRespectQuotes to handle escaped quotes and backslashes --- common/utils/strutil/string.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/utils/strutil/string.go b/common/utils/strutil/string.go index a3e4f24..9bb33f3 100644 --- a/common/utils/strutil/string.go +++ b/common/utils/strutil/string.go @@ -58,7 +58,12 @@ func ParseArgsRespectQuotes(input string) []string { for _, r := range input { switch { case escaped: - current.WriteRune(r) + if r == '"' || r == '\\' { + current.WriteRune(r) + } else { + current.WriteRune('\\') + current.WriteRune(r) + } escaped = false case r == '\\':