From 4174acdf00ef8b970371f24b98f7e43ce8e9fd54 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Tue, 15 May 2018 22:30:23 +0200 Subject: [PATCH] More info when spawning of editor-command fails. --- src/input.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/input.c b/src/input.c index 46aa2ba..3ee846c 100644 --- a/src/input.c +++ b/src/input.c @@ -112,6 +112,7 @@ VbResult input_open_editor(Client *c) GPid pid; gboolean success; GVariant *jsreturn; + GError *error = NULL; g_assert(c); @@ -136,7 +137,7 @@ VbResult input_open_editor(Client *c) } /* spawn editor */ - char* command = g_strdup_printf(editor_command, file_path); + char *command = g_strdup_printf(editor_command, file_path); if (!g_shell_parse_argv(command, &argc, &argv, NULL)) { g_critical("Could not parse editor-command '%s'", command); g_free(command); @@ -146,14 +147,15 @@ VbResult input_open_editor(Client *c) success = g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, &pid, NULL + NULL, NULL, &pid, &error ); g_strfreev(argv); if (!success) { unlink(file_path); g_free(file_path); - g_warning("Could not spawn editor-command"); + g_warning("Could not spawn editor-command: %s", error->message); + g_error_free(error); return RESULT_ERROR; } -- 2.20.1