diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2016-04-29 10:02:35 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2016-04-29 10:02:35 +0200 |
commit | b4ed91ff41f62519cb81031cec700436f7a68295 (patch) | |
tree | d05bdb1a6c4f33fc1cee0cab64c74249e10a8072 /bin | |
parent | f358e4fa5a9c4b2675025b00155308100bb589c9 (diff) |
run-json: print newline
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ufo-runjson.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/ufo-runjson.c b/bin/ufo-runjson.c index 2f6f5bc..7a201dc 100644 --- a/bin/ufo-runjson.c +++ b/bin/ufo-runjson.c @@ -72,12 +72,13 @@ execute_json (const gchar *filename, gchar **addresses) { UfoTaskGraph *task_graph; - UfoResources *resources; UfoBaseScheduler *scheduler; UfoPluginManager *manager; GList *leaves; + UfoResources *resources = NULL; GValueArray *address_list = NULL; GError *error = NULL; + gboolean has_tty; manager = ufo_plugin_manager_new (); @@ -85,9 +86,10 @@ execute_json (const gchar *filename, ufo_task_graph_read_from_file (task_graph, manager, filename, &error); handle_error ("Reading JSON", error, UFO_GRAPH (task_graph)); + has_tty = isatty (fileno (stdin)); leaves = ufo_graph_get_leaves (UFO_GRAPH (task_graph)); - if (isatty (fileno (stdin))) { + if (has_tty) { UfoTaskNode *leaf; leaf = UFO_TASK_NODE (leaves->data); @@ -107,13 +109,16 @@ execute_json (const gchar *filename, ufo_base_scheduler_run (scheduler, task_graph, &error); handle_error ("Executing", error, UFO_GRAPH (task_graph)); + if (has_tty) + g_print ("\n"); + g_list_free (leaves); g_object_unref (task_graph); g_object_unref (scheduler); g_object_unref (manager); - if (resources) + if (resources != NULL) g_object_unref (resources); } |