diff options
| author | christos <christos@NetBSD.org> | 2013-11-01 16:49:02 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2013-11-01 16:49:02 +0000 |
| commit | 68f67f7cc98bbb9fd448aef01eefe08abd50ff98 (patch) | |
| tree | 3017cf4d42f156d478a10423bd9cfa5d708c83cb /bin | |
| parent | 7c7fc7b8e367c1e629f697c79d785d5f58b1b96e (diff) | |
PR/48312: Dieter Roelands: According to TOG, unset should not return an error
for functions are variables that were not previously set:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/sh/exec.c | 7 | ||||
| -rw-r--r-- | bin/sh/var.c | 8 |
2 files changed, 7 insertions, 8 deletions
diff --git a/bin/sh/exec.c b/bin/sh/exec.c index 3a22b2a549a..739f51b7a07 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.44 2012/12/31 14:10:15 dsl Exp $ */ +/* $NetBSD: exec.c,v 1.45 2013/11/01 16:49:02 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: exec.c,v 1.44 2012/12/31 14:10:15 dsl Exp $"); +__RCSID("$NetBSD: exec.c,v 1.45 2013/11/01 16:49:02 christos Exp $"); #endif #endif /* not lint */ @@ -943,9 +943,8 @@ unsetfunc(char *name) cmdp->cmdtype == CMDFUNCTION) { freefunc(cmdp->param.func); delete_cmd_entry(); - return (0); } - return (1); + return 0; } /* diff --git a/bin/sh/var.c b/bin/sh/var.c index 15d03ca726c..d2ff93a15f7 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.42 2012/12/13 19:33:23 christos Exp $ */ +/* $NetBSD: var.c,v 1.43 2013/11/01 16:49:02 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: var.c,v 1.42 2012/12/13 19:33:23 christos Exp $"); +__RCSID("$NetBSD: var.c,v 1.43 2013/11/01 16:49:02 christos Exp $"); #endif #endif /* not lint */ @@ -754,10 +754,10 @@ unsetvar(const char *s, int unexport) vp = find_var(s, &vpp, NULL); if (vp == NULL) - return 1; + return 0; if (vp->flags & VREADONLY) - return (1); + return 1; INTOFF; if (unexport) { |
