diff options
| author | mycroft <mycroft@NetBSD.org> | 1994-08-24 05:48:26 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 1994-08-24 05:48:26 +0000 |
| commit | 08a673005488bb4e27b34b5fcedb7f5de2e28ffe (patch) | |
| tree | 68bf87e12d46ae5363ada8c48fc7259646a91d86 | |
| parent | 0797399a73deba772478586d3696caf3752c6ff6 (diff) | |
Fix a core dump and another parse error related to null commands.
| -rw-r--r-- | bin/sh/eval.c | 7 | ||||
| -rw-r--r-- | bin/sh/parser.c | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index d74f15a1fd6..15e7a2a3aaf 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -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); } diff --git a/bin/sh/parser.c b/bin/sh/parser.c index b3fef496cb0..03e9086929a 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -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++; |
