From 6a83ddacd3c63b059f30c155f8dffbaa9913cfd3 Mon Sep 17 00:00:00 2001 From: Victor Ananjevsky Date: Thu, 13 Jun 2013 14:09:29 +0300 Subject: [PATCH] Fix bug with segfault when we tried to create new file in an external editor (by pressing shift-F4) Signed-off-by: Slava Zanko --- src/execute.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/execute.c b/src/execute.c index 79bbeadae..d61fe345b 100644 --- a/src/execute.c +++ b/src/execute.c @@ -633,12 +633,16 @@ execute_external_editor_or_viewer (const char *command, const vfs_path_t * filen char **argv_cmd_options; int argv_count; - g_shell_parse_argv (extern_cmd_options, &argv_count, &argv_cmd_options, NULL); - g_free (extern_cmd_options); + if (g_shell_parse_argv (extern_cmd_options, &argv_count, &argv_cmd_options, NULL)) + { + do_executev (command, EXECUTE_INTERNAL, argv_cmd_options); + g_strfreev (argv_cmd_options); + } + else + do_executev (command, EXECUTE_INTERNAL, NULL); - do_executev (command, EXECUTE_INTERNAL, argv_cmd_options); + g_free (extern_cmd_options); - g_strfreev (argv_cmd_options); } execute_cleanup_with_vfs_arg (filename_vpath, &localcopy_vpath, &mtime); -- 2.11.4.GIT