diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-01-10 19:27:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2017-01-10 19:27:23 +0000 |
commit | 152bfa02f0693a8af3ba8a403f14c012351e4c71 (patch) | |
tree | 1d2bc3f07d7c94989156916dd8cb619af174736a /cmd.c | |
parent | a5c89a1802447217138f3dce1cb7aa0bcbd532e1 (diff) | |
parent | 570943beb75d462ff5f483d47d9735ade03d9ae7 (diff) | |
download | rtmux-152bfa02f0693a8af3ba8a403f14c012351e4c71.tar.gz rtmux-152bfa02f0693a8af3ba8a403f14c012351e4c71.tar.bz2 rtmux-152bfa02f0693a8af3ba8a403f14c012351e4c71.zip |
Merge branch 'master' of github.com:tmux/tmux
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -662,7 +662,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; @@ -691,7 +691,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; } |