From 7e151e3fe3ffb8586e9be9f7cf92a18fb4ebf600 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. --- usr.bin/tmux/utf8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/utf8.c b/usr.bin/tmux/utf8.c index 888d0157c3d..c5b775a53de 100644 --- a/usr.bin/tmux/utf8.c +++ b/usr.bin/tmux/utf8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.64 2023/09/15 15:49:05 nicm Exp $ */ +/* $OpenBSD: utf8.c,v 1.65 2024/05/24 12:41:24 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -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] == '{') -- 2.20.1