From owner-freebsd-current Sun Apr 9 00:34:09 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA09100 for current-outgoing; Sun, 9 Apr 1995 00:34:09 -0700 Received: from aries.ibms.sinica.edu.tw ([140.109.40.248]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id AAA09059 for ; Sun, 9 Apr 1995 00:33:52 -0700 Received: (from taob@localhost) by aries.ibms.sinica.edu.tw (8.6.11/8.6.9) id PAA23250; Sun, 9 Apr 1995 15:33:57 +0800 Date: Sun, 9 Apr 1995 15:33:56 +0800 (CST) From: Brian Tao cc: FREEBSD-CURRENT-L Subject: Re: man(1) bug In-Reply-To: <199504082139.PAA26018@trout.sri.MT.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: current-owner@FreeBSD.org Precedence: bulk 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