Fix PR/2504: return with no args returns 0 instead of the return value of
the previous command in functions
This commit is contained in:
parent
ff7a5b906d
commit
66824391d1
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: eval.c,v 1.29 1996/03/06 14:49:29 pk Exp $ */
|
||||
/* $NetBSD: eval.c,v 1.30 1996/06/03 12:21:17 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993
|
||||
@ -40,7 +40,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
|
||||
#else
|
||||
static char sccsid[] = "$NetBSD: eval.c,v 1.29 1996/03/06 14:49:29 pk Exp $";
|
||||
static char sccsid[] = "$NetBSD: eval.c,v 1.30 1996/06/03 12:21:17 christos Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -925,11 +925,8 @@ breakcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int n;
|
||||
int n = argc > 1 ? number(argv[1]) : 1;
|
||||
|
||||
n = 1;
|
||||
if (argc > 1)
|
||||
n = number(argv[1]);
|
||||
if (n > loopnest)
|
||||
n = loopnest;
|
||||
if (n > 0) {
|
||||
@ -949,11 +946,8 @@ returncmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int ret;
|
||||
int ret = argc > 1 ? number(argv[1]) : oexitstatus;
|
||||
|
||||
ret = exitstatus;
|
||||
if (argc > 1)
|
||||
ret = number(argv[1]);
|
||||
if (funcnest) {
|
||||
evalskip = SKIPFUNC;
|
||||
skipcount = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user