Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 1995 15:33:56 +0800 (CST)
From:      Brian Tao <taob@gate.sinica.edu.tw>
Cc:        FREEBSD-CURRENT-L <freebsd-current@FreeBSD.org>
Subject:   Re: man(1) bug
Message-ID:  <Pine.BSI.3.91.950409151300.23082A-100000@aries.ibms.sinica.edu.tw>
In-Reply-To: <199504082139.PAA26018@trout.sri.MT.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 8 Apr 1995, Nate Williams wrote:
> 
> 1) Use context diffs for the patch so we can make sure we're patching
>    the correct portion of the code.  It also helps to see the context of
>    the patch.  Use 'diff -c'.

    Yeah, that's what I get for sending out stuff when I'm in a
near-death state.  ;-)  Context diff for the non-kludgy fix follows:

*** man.c	Wed Aug 24 15:26:23 1994

--- man.c.new	Sun Apr  9 04:21:09 1995
***************
*** 458,464 ****
    register char **vs;
  
    for (vs = section_list; *vs != NULL; vs++)
!     if ((strcmp (*vs, name) == NULL) || (isdigit (name[0])))
        return strdup (name);
  
    return NULL;
--- 458,464 ----
    register char **vs;
  
    for (vs = section_list; *vs != NULL; vs++)
!     if ((strcmp (*vs, name) == NULL) || (isdigit (name[0]) && strlen(name) == 1))
        return strdup (name);
  
    return NULL;


> 2) Separate out the 'kludgy' fix from the not-so-kludgy so we can
>    install the good fix and try and improve on the second. :)

    The fix would be fairly trivial if we don't think we'll ever need
the filename globbing.  There's a bug somewhere in glob.c that does
not realize the [ metacharacter is missing the matching ].  I see the
code for the check in a couple of places, but either it isn't being
called, or it is returning the wrong value.

    For example, you can type something like "man \*" and get every
man page.  Sounds neat, but this is buggy too.  I can't type "man
Tk\*" and get all the Tk-related man pages, but I can type "man
\*Get\*" to see all man pages with the string "Get".  As well, the
only way to stop man from displaying all matching pages is to suspend
(from inside your pager) and killing the job.  Quitting or killing the
pager won't do you any good.  So to get the man page for [, you have
to (for now) type "man \\[".  That's the basis of my kludgy fix.

    IMHO, this is a useless feature that we can do without.  Unless
there is some critical application for this wildcard expansion in man,
I would much rather toss the whole thing out.  Or as Rod Grimes noted,
look at the 4.4BSD man instead.
-- 
Brian ("Though this be madness, yet there is method in't") Tao
taob@gate.sinica.edu.tw <-- work ........ play --> taob@io.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.91.950409151300.23082A-100000>