From 63a55dd06cb98e8b00a232ad8ae7b4ac133c4d6e Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Tue, 14 Jul 2015 10:47:49 -0700 Subject: [PATCH] Keep percent signs if not followed by {} block. The before code would skip a percent sign even if it was not followed by a {} block. The after code checks the same condition but only advances p if a {} block is found and otherwise passes it through as text. --- lemonbar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemonbar.c b/lemonbar.c index 794d815..ec00e6d 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -485,7 +485,8 @@ parse (char *text) if (*p == '\0' || *p == '\n') return; - if (*p == '%' && p++ && *p == '{' && (block_end = strchr(p++, '}'))) { + if (*p == '%' && *(p+1) == '{' && (block_end = strchr(p++, '}'))) { + p++; while (p < block_end) { while (isspace(*p)) p++;