summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-05-23 18:22:14 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-05-23 18:22:14 +0000
commit436798d3add4ef4c5d6581579a0dc8cdc0920d5e (patch)
tree46dc72d860279c1cb29637e0f61e20a35f2ab6d1
parent00f3dce9fb064a15957596c64cc9fe29ab9f3a2a (diff)
Environment variables can start with { also.
-rw-r--r--usr.bin/tmux/utf8.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/utf8.c b/usr.bin/tmux/utf8.c
index ea4f4e30093..eb6dcad08eb 100644
--- a/usr.bin/tmux/utf8.c
+++ b/usr.bin/tmux/utf8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utf8.c,v 1.41 2019/05/23 14:03:44 nicm Exp $ */
+/* $OpenBSD: utf8.c,v 1.42 2019/05/23 18:22:13 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -184,7 +184,9 @@ utf8_strvis(char *dst, const char *src, size_t len, int flag)
src -= ud.have;
}
if (src[0] == '$' && src < end - 1) {
- if (isalpha((u_char)src[1]) || src[1] == '_')
+ if (isalpha((u_char)src[1]) ||
+ src[1] == '_' ||
+ src[1] == '{')
*dst++ = '\\';
*dst++ = '$';
} else if (src < end - 1)