On input, ignore % w/o a { after.

This allows eg “Battery 88%” in the input w/o messing
up the colors.
This commit is contained in:
Timothy M. Schaeffer 2014-10-30 21:59:51 -04:00
parent f87c249d21
commit f07aa2db6f
1 changed files with 2 additions and 1 deletions

3
bar.c
View File

@ -362,7 +362,8 @@ parse (char *text)
if (*p == '\0' || *p == '\n')
return;
if (*p == '%' && p++ && *p == '{' && (end = strchr(p++, '}'))) {
if (*p == '%' && *(p+1) == '{' && (end = strchr(p+2, '}'))) {
p += 2;
while (p < end) {
while (isspace(*p))
p++;