On 02 Apr 2018, Paul Wise wrote:

>On Sun, 2018-04-01 at 18:19 +0000, Gabriel F. T. Gomes wrote:
>
>>    * Fix regression when MANPATH is set with colons (Closes:
>> #892307)  
>
>I noticed the upstream version of the fix misses these things:
>
> * falling back on `man --path` when the man implementation does not
>   have support for `manpath` and `man -w`
> * falling back on $MANPATH when the man implementation does not have
>   support for printing the manual pages paths
>
>Would it be possible for one of you to send them a fix for that?

Sorry for taking so long to reply to this.

I can definitely send this upstream, but since you have already
provided the solution in the bug report, may I set the author name to
"Paul Wise <[email protected]>" in the patch (git commit)?

It would look like this:



Author: Paul Wise <[email protected]>
Date:   Sun May 6 16:09:58 2018 -0300

    Fallbacks for man completion
    
    The commit
    
      commit e6a471511dfdc230ff3eed65ccba09b6d7d30262
      Author: Pawel <[email protected]>
      Date:   Wed Sep 27 06:34:59 2017 +0200
    
          man: Don't use $MANPATH directly (#161)
    
    fixes the behavior of man completion when MANPATH is set, however, it
    misses the following:
    
      * falling back on `man --path` when the man implementation does not
        have support for `manpath` and `man -w`
      * falling back on $MANPATH when the man implementation does not have
        support for printing the manual pages paths
    
    This patch addresses them.

diff --git a/completions/man b/completions/man
index 0668b8ee..d0068fc7 100644
--- a/completions/man
+++ b/completions/man
@@ -51,7 +51,8 @@ _man()
         return
     fi
 
-    local manpath=$( manpath 2>/dev/null || command man -w 2>/dev/null )
+    local manpath=$( manpath 2>/dev/null || command man -w 2>/dev/null || 
command man --path 2>/dev/null )
+    [[ -z $manpath ]] && manpath=$MANPATH
     [[ -z $manpath ]] && manpath="/usr/share/man:/usr/local/share/man"
 
     # determine manual section to search

Reply via email to