X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3status;a=blobdiff_plain;f=src%2Fprint_run_watch.c;h=0887521f5b71c8cd5da0b78168595b72f1755ae3;hp=b108f8fef85b728ac2d388b6055744c6c13bd400;hb=52e9f6f63b74db2a6a1d67524851649b18794950;hpb=9aafc38370e5f2b337643d22aa04f4d34208fb03 diff --git a/src/print_run_watch.c b/src/print_run_watch.c index b108f8f..0887521 100644 --- a/src/print_run_watch.c +++ b/src/print_run_watch.c @@ -23,15 +23,17 @@ void print_run_watch(yajl_gen json_gen, char *buffer, const char *title, const c for (; *walk != '\0'; walk++) { if (*walk != '%') { *(outwalk++) = *walk; - continue; - } - if (BEGINS_WITH(walk + 1, "title")) { + } else if (BEGINS_WITH(walk + 1, "title")) { outwalk += sprintf(outwalk, "%s", title); walk += strlen("title"); + } else if (BEGINS_WITH(walk + 1, "status")) { outwalk += sprintf(outwalk, "%s", (running ? "yes" : "no")); walk += strlen("status"); + + } else { + *(outwalk++) = '%'; } }