From f8fe1a50296d8bb04d9a4438beefc8cd57e29978 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Thu, 5 Dec 2013 07:39:17 +0000 Subject: [PATCH] urgency info is not exported in json with taskwarrior 2.0 --- src/tw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tw.c b/src/tw.c index 8235784..bad97fc 100644 --- a/src/tw.c +++ b/src/tw.c @@ -150,6 +150,7 @@ struct task **tw_get_all_tasks(const char *status) struct json_object *jtasks, *jtask, *json; struct task **tasks; char *opts; + const char *urg; opts = malloc(strlen("export status:") + strlen(status) + 1); @@ -198,7 +199,11 @@ struct task **tw_get_all_tasks(const char *status) tasks[i]->uuid = strdup(json_object_get_string(json)); json = json_object_object_get(jtask, "urgency"); - tasks[i]->urgency = strdup(json_object_get_string(json)); + urg = json_object_get_string(json); + if (urg) + tasks[i]->urgency = strdup(urg); + else + tasks[i]->urgency = NULL; tasks[i]->note = note_get(tasks[i]->uuid); } -- 2.7.4