diff options
Diffstat (limited to 'Src/builtin.c')
-rw-r--r-- | Src/builtin.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Src/builtin.c b/Src/builtin.c index a9d9b413e..0a2d55587 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -4239,22 +4239,19 @@ bin_eval(UNUSED(char *nam), char **argv, UNUSED(Options ops), UNUSED(int func)) scriptname = "(eval)"; prog = parse_string(zjoin(argv, ' ', 1)); - if (!prog) { - errflag = 0; - scriptname = oscriptname; - ineval = oineval; - return 1; - } + if (prog) { + lastval = 0; - lastval = 0; + execode(prog, 1, 0); - execode(prog, 1, 0); - - if (errflag) { - lastval = errflag; - errflag = 0; + if (errflag) + lastval = errflag; + } else { + lastval = 1; } + + errflag = 0; scriptname = oscriptname; ineval = oineval; |