From 0011fb1aaea0a02fc1d274e1644f5be9e8a5eed8 Mon Sep 17 00:00:00 2001 From: dg Date: Fri, 5 May 1995 06:34:13 +0000 Subject: 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(-) (limited to 'bin') diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 04b883b..b369050 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)); -- cgit v1.1