Cleanup command parsing logic

This commit is contained in:
Jurica Vukadin 2014-01-13 22:46:52 +01:00
parent 1efcc61006
commit 0fb530e1a2

9
bar.c
View File

@ -326,11 +326,10 @@ parse (char *text)
cmd_area_begin (screen, pos_x, align); cmd_area_begin (screen, pos_x, align);
break; break;
case 'c': case 'c':
if (p++) cmd_start = ++p;
cmd_start = p; while (*p != '\0' && *p != '\n' && *p != '\\')
while (p++ && *p != '\0' && *p != '\n' && *p != '\\') p++;
; continue;
continue;
case 'e': case 'e':
cmd_area_end (screen, pos_x, align); cmd_area_end (screen, pos_x, align);
size_t cmd_len = (size_t)(p - cmd_start) - 2; size_t cmd_len = (size_t)(p - cmd_start) - 2;