From 692ce59bcef5fcbbe60485bada35126ad9b87d59 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 24 May 2024 12:41:24 +0000 Subject: [PATCH] Do not escape $ unless DQ is set, that is the only case where we need to escape it. --- utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utf8.c b/utf8.c index 0abb7875..03ab7e93 100644 --- a/utf8.c +++ b/utf8.c @@ -517,7 +517,7 @@ utf8_strvis(char *dst, const char *src, size_t len, int flag) /* Not a complete, valid UTF-8 character. */ src -= ud.have; } - if (src[0] == '$' && src < end - 1) { + if ((flag & VIS_DQ) && src[0] == '$' && src < end - 1) { if (isalpha((u_char)src[1]) || src[1] == '_' || src[1] == '{')