Module Name:    src
Committed By:   christos
Date:           Fri Nov  1 16:49:02 UTC 2013

Modified Files:
        src/bin/sh: exec.c var.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/bin/sh/exec.c
cvs rdiff -u -r1.42 -r1.43 src/bin/sh/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/exec.c
diff -u src/bin/sh/exec.c:1.44 src/bin/sh/exec.c:1.45
--- src/bin/sh/exec.c:1.44	Mon Dec 31 09:10:15 2012
+++ src/bin/sh/exec.c	Fri Nov  1 12:49:02 2013
@@ -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;
 }
 
 /*

Index: src/bin/sh/var.c
diff -u src/bin/sh/var.c:1.42 src/bin/sh/var.c:1.43
--- src/bin/sh/var.c:1.42	Thu Dec 13 14:33:23 2012
+++ src/bin/sh/var.c	Fri Nov  1 12:49:02 2013
@@ -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) {

Reply via email to