summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authornicm <nicm>2019-08-29 07:13:48 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2019-09-16 08:59:49 +0100
commitc45b255a885f36e033e1dfba1776fb5c04bfb6cf (patch)
tree1e0d8d5da7405dd8e31d6bb2339feedd441d0e4c /cmd.c
parent5e4f3714084dc3edcc8f5e9bfcc86faeb92d900a (diff)
It is not longer necessary to double-escape ; in %%%, problem reported
by Theo Buehler.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/cmd.c b/cmd.c
index 7c9d89c8..96cedc97 100644
--- a/cmd.c
+++ b/cmd.c
@@ -660,7 +660,7 @@ char *
cmd_template_replace(const char *template, const char *s, int idx)
{
char ch, *buf;
- const char *ptr, *cp, quote[] = "\"\\$";
+ const char *ptr, *cp, quote[] = "\"\\$;";
int replaced, quoted;
size_t len;
@@ -691,10 +691,6 @@ cmd_template_replace(const char *template, const char *s, int idx)
for (cp = s; *cp != '\0'; cp++) {
if (quoted && strchr(quote, *cp) != NULL)
buf[len++] = '\\';
- if (quoted && *cp == ';') {
- buf[len++] = '\\';
- buf[len++] = '\\';
- }
buf[len++] = *cp;
}
buf[len] = '\0';