diff options
author | Ingo Bürk | 2018-07-13 15:17:51 +0200 |
---|---|---|
committer | GitHub | 2018-07-13 15:17:51 +0200 |
commit | fc9da67e65819cb14071db4fd5b7941ab01a1134 (patch) | |
tree | 5f6ab7b574e6fad71cdd2d8ac21c19ba0768d936 /src/print_path_exists.c | |
parent | Merge pull request #256 from oyvinht/master (diff) | |
parent | able to print percentage (diff) |
Merge pull request #297 from Stunkymonkey/percent-first
able to print percentage
Diffstat (limited to 'src/print_path_exists.c')
-rw-r--r-- | src/print_path_exists.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/print_path_exists.c b/src/print_path_exists.c index 65bc9c8..7bdbe30 100644 --- a/src/print_path_exists.c +++ b/src/print_path_exists.c @@ -25,15 +25,17 @@ void print_path_exists(yajl_gen json_gen, char *buffer, const char *title, const 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", (exists ? "yes" : "no")); walk += strlen("status"); + + } else { + *(outwalk++) = '%'; } } |