aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-13 19:11:33 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-13 19:11:33 +0100
commitdc6358b0e1d0dca85c5d7114973adcff7ed36bfb (patch)
tree29892fde9742c51aa638340efd792b29ffcb81cf /lib
parent7ee95668ca7d8a1bdf3b423a068280c7dab07781 (diff)
rdline: always do substitution of '%%'
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/libcfg/rdline.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libcfg/rdline.c b/lib/libcfg/rdline.c
index b0cd789..87d431e 100644
--- a/lib/libcfg/rdline.c
+++ b/lib/libcfg/rdline.c
@@ -142,6 +142,8 @@ static void substitute(rdline_t *t, char *dst, char *src)
*(dst++) = *(src++);
}
}
+
+ *(dst++) = '\0';
}
int rdline(rdline_t *t)
@@ -156,8 +158,10 @@ int rdline(rdline_t *t)
goto out;
} while (t->line[0] == '\0');
- if (ret == 0)
+ if (ret == 0) {
+ substitute(t, t->line, t->line);
return 0;
+ }
buffer = calloc(1, strlen(t->line) + ret + 1);
if (buffer == NULL) {