# HG changeset patch # User zas_ # Date 1212132025 0 # Node ID 7148e125bf230f89f1115c05f7e15d6279d11451 # Parent 339db85846da18e1e8ea7c89d25a4be7c7077e89 Check for existing editor command using is_valid_editor_command(). diff -r 339db85846da -r 7148e125bf23 src/editors.c --- a/src/editors.c Thu May 29 07:58:34 2008 +0000 +++ b/src/editors.c Fri May 30 07:20:25 2008 +0000 @@ -808,7 +808,7 @@ return flags & EDITOR_ERROR_MASK; } -static gint is_valid_editor_command(gint n) +gboolean is_valid_editor_command(gint n) { return (n >= 0 && n < GQ_EDITOR_SLOTS && options->editor[n].command diff -r 339db85846da -r 7148e125bf23 src/editors.h --- a/src/editors.h Thu May 29 07:58:34 2008 +0000 +++ b/src/editors.h Fri May 30 07:20:25 2008 +0000 @@ -74,4 +74,6 @@ const gchar *editor_get_name(gint n); +gboolean is_valid_editor_command(gint n); + #endif diff -r 339db85846da -r 7148e125bf23 src/trash.c --- a/src/trash.c Thu May 29 07:58:34 2008 +0000 +++ b/src/trash.c Fri May 30 07:20:25 2008 +0000 @@ -15,7 +15,7 @@ #include "trash.h" #include "utilops.h" - +#include "editors.h" #include "filedata.h" #include "ui_fileops.h" #include "ui_misc.h" @@ -181,7 +181,7 @@ { gchar *buf; - if (options->editor[CMD_DELETE].command) + if (is_valid_editor_command(CMD_DELETE)) { buf = g_strdup(_("Deletion by external command")); } diff -r 339db85846da -r 7148e125bf23 src/utilops.c --- a/src/utilops.c Thu May 29 07:58:34 2008 +0000 +++ b/src/utilops.c Fri May 30 07:20:25 2008 +0000 @@ -667,7 +667,7 @@ break; } - if (ud->external_command != -1 && options->editor[ud->external_command].command) + if (is_valid_editor_command(ud->external_command)) { gint flags;