From owner-freebsd-bugs Wed Mar 20 13: 0: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 47F3A37B404 for ; Wed, 20 Mar 2002 13:00:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2KL03O84404; Wed, 20 Mar 2002 13:00:03 -0800 (PST) (envelope-from gnats) Date: Wed, 20 Mar 2002 13:00:03 -0800 (PST) Message-Id: <200203202100.g2KL03O84404@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: George Reid Subject: Re: bin/36141: sh dumps core Reply-To: George Reid Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/36141; it has been noted by GNATS. From: George Reid To: Jan Willem Knopper Cc: FreeBSD-gnats-submit@FreeBSD.org Subject: Re: bin/36141: sh dumps core Date: Wed, 20 Mar 2002 20:56:44 +0000 On Wed, Mar 20, 2002 at 07:52:31PM +0100, Jan Willem Knopper wrote: > >Description: > sh coredumps when the builtin function hash is invocated with > option -v and as an argument a full path (i.e. hash -v /bin/sh) Please try the included patch. Should apply to CURRENT or STABLE. Does sh have a MAINTAINER? Index: exec.c =================================================================== RCS file: /usr/home/ncvs/src/bin/sh/exec.c,v retrieving revision 1.16 diff -u -r1.16 exec.c --- exec.c 2 Feb 2002 06:50:46 -0000 1.16 +++ exec.c 20 Mar 2002 20:53:10 -0000 @@ -350,7 +350,10 @@ if (verbose) { if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ cmdp = cmdlookup(name, 0); - printentry(cmdp, verbose); + if (cmdp != NULL) + printentry(cmdp, verbose); + else + outfmt(&errout, "%s: not found\n", name); } flushall(); } -- George C A Reid Tel: (08701) 200870 Ext. 26654 WWW: http://people.FreeBSD.org/~greid/ Mob: (07740) 197460 FreeBSD Committer/Developer greid@FreeBSD.org Oriel College, Oxford University george.reid@oriel.ox.ac.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message