diff options
author | dg <dg@FreeBSD.org> | 1995-05-05 06:34:13 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-05 06:34:13 +0000 |
commit | 0011fb1aaea0a02fc1d274e1644f5be9e8a5eed8 (patch) | |
tree | 763ef2d73e623984246d47d7ccaf11e8e420b22f /bin/sh | |
parent | 8af384fe4a8ef40ed8cf73e00b9f7a392c46909e (diff) | |
download | FreeBSD-src-0011fb1aaea0a02fc1d274e1644f5be9e8a5eed8.zip FreeBSD-src-0011fb1aaea0a02fc1d274e1644f5be9e8a5eed8.tar.gz |
From "Philippe Charnier" <charnier@lirmm.fr>:
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.
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/histedit.c | 6 |
1 files changed, 5 insertions, 1 deletions
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)); |