aboutsummaryrefslogtreecommitdiff
path: root/src/compose.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-28 02:46:11 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-12-28 02:46:11 +0000
commitf9fa5fc5a148747f0ee928374984a64c50440915 (patch)
treedaed914b79c629a207d11022840296851fc0b4b3 /src/compose.c
parenteeb4859e9b0621f390bc42389091d1dbef4bc3cc (diff)
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
Diffstat (limited to 'src/compose.c')
-rw-r--r--src/compose.c12
1 files changed, 10 insertions, 2 deletions
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);