[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] .edit: Fix bug searching for sensible-editor

From: Jose E. Marchesi
Subject: Re: [PATCH] .edit: Fix bug searching for sensible-editor
Date: Sat, 29 Feb 2020 15:18:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

         But this makes me think whether `find_in_path' is the right tool to
         determine whether sensible-editor exists or not.  What if the user has
         . in her PATH and her sensible-editor is in the current directory, for
    I don't see what problems that would cause.  find_in_path would find 
    and run it.  Where would the problem be?

Wouldn't find_in_path return "sensible-editor" in that case?  Then
editor would be NULL.
              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");

reply via email to

[Prev in Thread] Current Thread [Next in Thread]