]> git.sur5r.net Git - i3/i3status/blobdiff - src/print_run_watch.c
Switch to autotools (#316)
[i3/i3status] / src / print_run_watch.c
index b108f8fef85b728ac2d388b6055744c6c13bd400..f0a0746b0984d46dfef18267b151b95d2a18c277 100644 (file)
@@ -1,4 +1,5 @@
 // vim:ts=4:sw=4:expandtab
+#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <yajl/yajl_gen.h>
@@ -23,15 +24,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++) = '%';
         }
     }