Fix a core dump and another parse error related to null commands.
This commit is contained in:
parent
0797399a73
commit
08a6730054
|
@ -36,7 +36,7 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)eval.c 8.1 (Berkeley) 5/31/93";*/
|
||||
static char *rcsid = "$Id: eval.c,v 1.14 1994/06/14 05:49:19 jtc Exp $";
|
||||
static char *rcsid = "$Id: eval.c,v 1.15 1994/08/24 05:48:26 mycroft Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -866,8 +866,9 @@ prehash(n)
|
|||
{
|
||||
struct cmdentry entry;
|
||||
|
||||
if (n->type == NCMD && goodname(n->ncmd.args->narg.text))
|
||||
find_command(n->ncmd.args->narg.text, &entry, 0);
|
||||
if (n->type == NCMD && n->ncmd.args)
|
||||
if (goodname(n->ncmd.args->narg.text))
|
||||
find_command(n->ncmd.args->narg.text, &entry, 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)parser.c 8.1 (Berkeley) 5/31/93";*/
|
||||
static char *rcsid = "$Id: parser.c,v 1.19 1994/07/07 20:53:32 mycroft Exp $";
|
||||
static char *rcsid = "$Id: parser.c,v 1.20 1994/08/24 05:48:28 mycroft Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "shell.h"
|
||||
|
@ -459,6 +459,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
|
|||
if (!redir)
|
||||
synexpect(-1);
|
||||
case TNL:
|
||||
case TEOF:
|
||||
case TWORD:
|
||||
case TRP:
|
||||
tokpushback++;
|
||||
|
|
Loading…
Reference in New Issue