From f9fa5fc5a148747f0ee928374984a64c50440915 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 28 Dec 2006 02:46:11 +0000 Subject: compose_exec_ext_editor(): display verbose error message. Fixed a memory leak. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1460 ee746299-78ed-0310-b773-934348b2243d --- src/compose.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compose.c b/src/compose.c index 3f25d6fb..b00f3a2a 100644 --- a/src/compose.c +++ b/src/compose.c @@ -5596,6 +5596,7 @@ static void compose_exec_ext_editor(Compose *compose) static gchar *def_cmd = "emacs %s"; gchar buf[1024]; gchar **cmdline; + GError *error = NULL; tmp = g_strdup_printf("%s%ctmpmsg-%p.txt", get_tmp_dir(), G_DIR_SEPARATOR, compose); @@ -5627,13 +5628,20 @@ static void compose_exec_ext_editor(Compose *compose) if (g_spawn_async(NULL, cmdline, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, - NULL, NULL, &pid, NULL) == FALSE) { - g_warning("Couldn't execute external editor\n"); + NULL, NULL, &pid, &error) == FALSE) { + g_warning("Couldn't execute external editor: %s\n", buf); + if (error) { + g_warning("g_spawn_async(): %s\n", error->message); + g_error_free(error); + } + g_strfreev(cmdline); g_unlink(tmp); g_free(tmp); return; } + g_strfreev(cmdline); + compose_set_ext_editor_sensitive(compose, FALSE); debug_print("compose_exec_ext_editor(): pid: %d file: %s\n", pid, tmp); -- cgit v1.2.3