[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] .edit: Fix bug searching for sensible-editor
From: |
John Darrington |
Subject: |
[PATCH] .edit: Fix bug searching for sensible-editor |
Date: |
Sat, 29 Feb 2020 14:38:40 +0100 |
Contrary to what I thought, find_in_path returns its argument
verbatim (and not null) if the program is not found.
---
src/pk-editor.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/pk-editor.c b/src/pk-editor.c
index fd7664c4..ad2f33cc 100644
--- a/src/pk-editor.c
+++ b/src/pk-editor.c
@@ -48,7 +48,11 @@ pk_cmd_editor (int argc, struct pk_cmd_arg argv[], uint64_t
uflags)
/* Debian based systems should always have "sensible-editor"
in the path. */
if (!editor)
- editor = find_in_path ("sensible-editor");
+ {
+ editor = find_in_path ("sensible-editor");
+ if (strcmp (editor, "sensible-editor") == 0)
+ editor = NULL;
+ }
if (!editor)
{
pk_term_class ("error");
--
2.20.1
- [PATCH] .edit: Fix bug searching for sensible-editor,
John Darrington <=