From 24e98f1e5b7dba6af0d2524127098c04530680a2 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 20 Oct 2018 17:40:45 +0200 Subject: Fix parameter substitution escape of '%' Signed-off-by: David Oberhollenzer --- lib/libcfg/rdline.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libcfg') 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; -- cgit v1.2.3