From 3fb099396942922bae91671fe9e63b21a7ca9cd0 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Fri, 5 May 1995 06:34:13 +0000 Subject: [PATCH] From "Philippe Charnier" : There is a bug in sh: the built in command "fc -l" generates a core dump (*NULL in not_fcnumber). According to the sh manual page (fc -l [-nr] [first [last]]), fc -l is a correct sequence (in that case, values are defaulted to -16 and -1) but fails when first is not given. --- bin/sh/histedit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 04b883be236d..b369050af7c5 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: histedit.c,v 1.2 1994/09/24 02:57:36 davidg Exp $ */ #ifndef lint @@ -389,6 +389,10 @@ fc_replace(s, p, r) not_fcnumber(s) char *s; { + if (s == NULL) { + /* NULL is not a fc_number */ + return (1); + } if (*s == '-') s++; return (!is_number(s));