about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-04-04 16:46:25 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-04-04 16:46:25 +0000
commit06b04ca1b2d7dcbc77787a248241c6968808d40c (patch)
tree75ec8957316013c6c311c7ffc9f35ee7ddcb5783 /Src/params.c
parentc1bef473646c5f9c44f53aab4c9f9a0ee33a8454 (diff)
downloadzsh-06b04ca1b2d7dcbc77787a248241c6968808d40c.tar.gz
zsh-06b04ca1b2d7dcbc77787a248241c6968808d40c.tar.xz
zsh-06b04ca1b2d7dcbc77787a248241c6968808d40c.zip
18435: unsetting readonly returned status 0
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Src/params.c b/Src/params.c
index 29f6e4072..61aa3456a 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2214,18 +2214,18 @@ unsetparam(char *s)
 /* Unset a parameter */
 
 /**/
-mod_export void
+mod_export int
 unsetparam_pm(Param pm, int altflag, int exp)
 {
     Param oldpm, altpm;
 
     if ((pm->flags & PM_READONLY) && pm->level <= locallevel) {
 	zerr("read-only variable: %s", pm->nam, 0);
-	return;
+	return 1;
     }
     if ((pm->flags & PM_RESTRICTED) && isset(RESTRICTED)) {
 	zerr("%s: restricted", pm->nam, 0);
-	return;
+	return 1;
     }
     pm->unsetfn(pm, exp);
     if ((pm->flags & PM_EXPORTED) && pm->env) {
@@ -2267,7 +2267,7 @@ unsetparam_pm(Param pm, int altflag, int exp)
      */
     if ((pm->level && locallevel >= pm->level) ||
 	(pm->flags & (PM_SPECIAL|PM_REMOVABLE)) == PM_SPECIAL)
-	return;
+	return 0;
 
     /* remove parameter node from table */
     paramtab->removenode(paramtab, pm->nam);
@@ -2292,6 +2292,8 @@ unsetparam_pm(Param pm, int altflag, int exp)
     }
 
     paramtab->freenode((HashNode) pm); /* free parameter node */
+
+    return 0;
 }
 
 /* Standard function to unset a parameter.  This is mostly delegated to *