aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-10-20 17:40:45 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-10-20 17:41:22 +0200
commit24e98f1e5b7dba6af0d2524127098c04530680a2 (patch)
tree595ee5ea83839b06a16b600e832d960b0906a0a2
parentef51a8e06f63db0d5182d55a445a17be45733513 (diff)
Fix parameter substitution escape of '%'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
-rw-r--r--lib/libcfg/rdline.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libcfg/rdline.c b/lib/libcfg/rdline.c
index 16ca5cf..3c3fcb3 100644
--- a/lib/libcfg/rdline.c
+++ b/lib/libcfg/rdline.c
@@ -125,6 +125,9 @@ static void substitute(rdline_t *t, char *dst, char *src)
src += 2;
while (*dst != '\0')
++dst;
+ } else if (src[0] == '%' && src[1] == '%') {
+ *(dst++) = '%';
+ src += 2;
} else {
if (*src == '"')
string = !string;