From 0fb530e1a28e195344d3428f6cc5c6235cf84010 Mon Sep 17 00:00:00 2001 From: Jurica Vukadin Date: Mon, 13 Jan 2014 22:46:52 +0100 Subject: [PATCH] Cleanup command parsing logic --- bar.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bar.c b/bar.c index c24452d..2f49929 100644 --- a/bar.c +++ b/bar.c @@ -326,11 +326,10 @@ parse (char *text) cmd_area_begin (screen, pos_x, align); break; case 'c': - if (p++) - cmd_start = p; - while (p++ && *p != '\0' && *p != '\n' && *p != '\\') - ; - continue; + cmd_start = ++p; + while (*p != '\0' && *p != '\n' && *p != '\\') + p++; + continue; case 'e': cmd_area_end (screen, pos_x, align); size_t cmd_len = (size_t)(p - cmd_start) - 2;