From aa68da1ce6341a01e7ee37e606dd1b4b090416f1 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sat, 6 Jun 2009 12:18:46 -0600 Subject: [PATCH] Fix bug in template code. Signed-off-by: Brenden Matthews --- src/conky.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conky.c b/src/conky.c index b272eaf9..4efe7a6c 100644 --- a/src/conky.c +++ b/src/conky.c @@ -2989,12 +2989,12 @@ static char *handle_template(const char *tmpl, const char *args) args_dup = strdup(args); p = args_dup; while (*p) { - while (*p && (*p == ' ' && p > args_dup && *(p - 1) != '\\')) + while (*p && (*p == ' ' && (p == args_dup || *(p - 1) != '\\'))) p++; if (p > args_dup && *(p - 1) == '\\') p--; p_old = p; - while (*p && (*p != ' ' || p == args_dup || *(p - 1) == '\\')) + while (*p && (*p != ' ' || (p > args_dup && *(p - 1) == '\\'))) p++; if (*p) { (*p) = '\0';