# HG changeset patch # User zas_ # Date 1236524538 0 # Node ID 7dfa34e4de154b59a2995fbcb5b7127b448b145e # Parent 9e7aed6ba6bd8bc1839330cfba13ee0496b1a802 Fix up editor execution. diff -r 9e7aed6ba6bd -r 7dfa34e4de15 src/editors.c --- a/src/editors.c Sun Mar 08 14:27:19 2009 +0000 +++ b/src/editors.c Sun Mar 08 15:02:18 2009 +0000 @@ -688,28 +688,30 @@ flags |= EDITOR_ERROR_INCOMPATIBLE; goto err; } - /* use the first file from the list */ - if (!list || !list->data) - { - flags |= EDITOR_ERROR_NO_FILE; - goto err; - } - pathl = editor_command_path_parse((FileData *)list->data, - (*p == 'f') ? PATH_FILE : PATH_FILE_URL, - editor); - if (!pathl) + if (list) { - flags |= EDITOR_ERROR_NO_FILE; - goto err; + /* use the first file from the list */ + if (!list->data) + { + flags |= EDITOR_ERROR_NO_FILE; + goto err; + } + pathl = editor_command_path_parse((FileData *)list->data, + (*p == 'f') ? PATH_FILE : PATH_FILE_URL, + editor); + if (!pathl) + { + flags |= EDITOR_ERROR_NO_FILE; + goto err; + } + if (output) + { + result = g_string_append_c(result, '"'); + result = g_string_append(result, pathl); + result = g_string_append_c(result, '"'); + } + g_free(pathl); } - if (output) - { - result = g_string_append_c(result, '"'); - result = g_string_append(result, pathl); - result = g_string_append_c(result, '"'); - } - g_free(pathl); - break; case 'F': @@ -721,6 +723,7 @@ goto err; } + if (list) { /* use whole list */ GList *work = list;