Subject: bin/928: sh dumping core on fc -l
To: None <gnats-admin@NetBSD.ORG>
From: Kenneth Stailey <kstailey@leidecker.gsfc.nasa.gov>
List: netbsd-bugs
Date: 03/30/1995 06:35:02
>Number:         928
>Category:       bin
>Synopsis:       sh dumping core on fc -l
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 30 06:35:01 1995
>Originator:     Kenneth Stailey
>Organization:
bug report cleanup crew
>Release:        NetBSD 1.0A March 18 1995
>Environment:
System: NetBSD pluto 1.0A NetBSD 1.0A (PLUTO) #25: Tue Mar 28 13:17:39 EST 1995 ken@pluto:/usr/src/sys/arch/i386/compile/PLUTO i386


>Description:
	On a "fc -l" (no additional params the sh dumps core.
	The syntax allowes this but the parser in histedit.c barfs.
	a simple test in not_fcnumber() fixes this.

>How-To-Repeat:
	using /bin/sh type "fc -l"

>Fix:

--- histedit.c.DIST	Thu Mar 30 09:23:55 1995
+++ histedit.c	Wed Mar 29 18:15:32 1995
@@ -402,6 +402,8 @@
 not_fcnumber(s)
         char *s;
 {
+	if (s == NULL)
+		return 0;
         if (*s == '-')
                 s++;
 	return (!is_number(s));

--JAA00492.796573475/pluto.spacenet.com--


>Audit-Trail:
>Unformatted: