diff options
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; } |