# HG changeset patch # User nadvornik # Date 1252356269 0 # Node ID 1cc12c4b841ae50e98aa09d54042f67a775bea3d # Parent eb64f542341b78d24963b8d8af7476db0162814a start_editor_from_filelist_full fixes fixed return value from start_editor_from_filelist_full() call editor_command_parse to detect possible problems early enough diff -r eb64f542341b -r 1cc12c4b841a src/editors.c --- a/src/editors.c Mon Sep 07 20:04:22 2009 +0000 +++ b/src/editors.c Mon Sep 07 20:44:29 2009 +0000 @@ -1225,14 +1225,18 @@ { EditorFlags error; EditorDescription *editor; - if (!key) return FALSE; + if (!key) return EDITOR_ERROR_EMPTY; editor = g_hash_table_lookup(editors, key); - if (!editor) return FALSE; - if (!list && !(editor->flags & EDITOR_NO_PARAM)) return FALSE; + if (!editor) return EDITOR_ERROR_EMPTY; + if (!list && !(editor->flags & EDITOR_NO_PARAM)) return EDITOR_ERROR_NO_FILE; - error = editor_command_start(editor, editor->name, list, working_directory, cb, data); + error = editor_command_parse(editor, list, TRUE, NULL); + + if (EDITOR_ERRORS(error)) return error; + + error |= editor_command_start(editor, editor->name, list, working_directory, cb, data); if (EDITOR_ERRORS(error)) { @@ -1242,7 +1246,7 @@ g_free(text); } - return error; + return EDITOR_ERRORS(error); } EditorFlags start_editor_from_filelist(const gchar *key, GList *list) diff -r eb64f542341b -r 1cc12c4b841a src/utilops.c --- a/src/utilops.c Mon Sep 07 20:04:22 2009 +0000 +++ b/src/utilops.c Mon Sep 07 20:44:29 2009 +0000 @@ -872,7 +872,7 @@ } } - if (flags) + if (EDITOR_ERRORS(flags)) { gchar *text = g_strdup_printf(_("%s\nUnable to start external command.\n"), editor_get_error_str(flags)); file_util_warning_dialog(ud->messages.fail, text, GTK_STOCK_DIALOG_ERROR, NULL);