diff options
author | 2017-01-10 11:58:30 +0000 | |
---|---|---|
committer | 2017-01-10 11:58:30 +0000 | |
commit | 785b97212d76a4c5974da843c1a96fa5c587f01e (patch) | |
tree | 56dc1860310c615d813035f6d2e2739b72853d84 /usr.bin/tmux/cmd.c | |
parent | enable acpihve(4) (diff) | |
download | wireguard-openbsd-785b97212d76a4c5974da843c1a96fa5c587f01e.tar.xz wireguard-openbsd-785b97212d76a4c5974da843c1a96fa5c587f01e.zip |
Quote backslash as well for %%%.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r-- | usr.bin/tmux/cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index d5f325fa0f8..5703e6f5ab3 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.130 2017/01/06 11:57:03 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.131 2017/01/10 11:58:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -663,7 +663,7 @@ char * cmd_template_replace(const char *template, const char *s, int idx) { char ch, *buf; - const char *ptr, *cp; + const char *ptr, *cp, quote[] = "\"\\$"; int replaced, quoted; size_t len; @@ -692,7 +692,7 @@ cmd_template_replace(const char *template, const char *s, int idx) buf = xrealloc(buf, len + (strlen(s) * 2) + 1); for (cp = s; *cp != '\0'; cp++) { - if (quoted && (*cp == '"' || *cp == '$')) + if (quoted && strchr(quote, *cp) != NULL) buf[len++] = '\\'; buf[len++] = *cp; } |