mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
A couple more fixes for the template machinery
Signed-off-by: Brenden Matthews <brenden@rty.ca>
This commit is contained in:
parent
20e4e19f83
commit
c76b7f577d
@ -2982,12 +2982,12 @@ static char *handle_template(const char *tmpl, const char *args)
|
||||
args_dup = strdup(args);
|
||||
p = args_dup;
|
||||
while (*p) {
|
||||
while (*p && (*p == ' ' && *(p - 1) != '\\'))
|
||||
while (*p && (*p == ' ' && p > args_dup && *(p - 1) != '\\'))
|
||||
p++;
|
||||
if (*(p - 1) == '\\')
|
||||
if (p > args_dup && *(p - 1) == '\\')
|
||||
p--;
|
||||
p_old = p;
|
||||
while (*p && (*p != ' ' || *(p - 1) == '\\'))
|
||||
while (*p && (*p != ' ' || p == args_dup || *(p - 1) == '\\'))
|
||||
p++;
|
||||
if (*p) {
|
||||
(*p) = '\0';
|
||||
@ -3069,6 +3069,7 @@ static char *find_and_replace_templates(const char *inbuf)
|
||||
tmpl_out = handle_template(templ, args);
|
||||
if (tmpl_out) {
|
||||
outlen += strlen(tmpl_out);
|
||||
*o = '\0';
|
||||
outbuf = realloc(outbuf, outlen * sizeof(char));
|
||||
strcat (outbuf, tmpl_out);
|
||||
free(tmpl_out);
|
||||
|
Loading…
Reference in New Issue
Block a user