From 1411d260a4c6956ff5a3699ee9bfd5b275209fe3 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Tue, 9 May 2017 15:56:59 +0200 Subject: [PATCH] Correctly handle escaped % symbols --- lemonbar.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lemonbar.c b/lemonbar.c index 43aab8c..9220af0 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -602,6 +602,10 @@ parse (char *text) // Eat the trailing } p++; } else { // utf-8 -> ucs-2 + // Escaped % symbol, eat the first one + if (p[0] == '%' && p[1] == '%') + p++; + uint8_t *utf = (uint8_t *)p; uint16_t ucs;