When parsing def_editor, break out of the loop when we find the

first valid editor.  Bug #714
This commit is contained in:
Todd C. Miller
2015-08-21 11:25:02 -06:00
parent 7df2487165
commit 333faa20e2
3 changed files with 10 additions and 2 deletions

View File

@@ -1201,7 +1201,9 @@ find_editor(int nfiles, char **files, int *argc_out, char ***argv_out)
if ((editor = getenv(*ev)) != NULL && *editor != '\0') {
editor_path = resolve_editor(editor, strlen(editor),
nfiles, files, argc_out, argv_out, NULL);
if (editor_path == NULL && errno != ENOENT)
if (editor_path != NULL)
break;
if (errno != ENOENT)
debug_return_str(NULL);
}
}