mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
570943beb7
4
cmd.c
4
cmd.c
@ -662,7 +662,7 @@ char *
|
|||||||
cmd_template_replace(const char *template, const char *s, int idx)
|
cmd_template_replace(const char *template, const char *s, int idx)
|
||||||
{
|
{
|
||||||
char ch, *buf;
|
char ch, *buf;
|
||||||
const char *ptr, *cp;
|
const char *ptr, *cp, quote[] = "\"\\$";
|
||||||
int replaced, quoted;
|
int replaced, quoted;
|
||||||
size_t len;
|
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);
|
buf = xrealloc(buf, len + (strlen(s) * 2) + 1);
|
||||||
for (cp = s; *cp != '\0'; cp++) {
|
for (cp = s; *cp != '\0'; cp++) {
|
||||||
if (quoted && (*cp == '"' || *cp == '$'))
|
if (quoted && strchr(quote, *cp) != NULL)
|
||||||
buf[len++] = '\\';
|
buf[len++] = '\\';
|
||||||
buf[len++] = *cp;
|
buf[len++] = *cp;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user