summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-03-29 10:52:15 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-03-29 10:52:15 +0000
commit3278ad8490ce04f5178e8873661a369f34d04531 (patch)
tree9ad62a90dd4a228082e948e66043d7c9549675a7
parent32f8d43b61e357d38a3bf4f6a5bf63b2aa547945 (diff)
downloadzsh-3278ad8490ce04f5178e8873661a369f34d04531.tar.gz
zsh-3278ad8490ce04f5178e8873661a369f34d04531.tar.xz
zsh-3278ad8490ce04f5178e8873661a369f34d04531.zip
disallow changing of parameter type
for autoloadable parameter (bug 219459 on Sourceforge).
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e478b7d3..85edc7ccd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-03-29  Peter Stephenson  <pws@csr.com>
+
+	* 13837: Src/builtin.c: disallows changing of parameter type
+	for autoloadable parameter (bug 219459 on Sourceforge).
+
 2001-03-29  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 13833: Completion/Core/_expand: fix comparison of expansions
diff --git a/Src/builtin.c b/Src/builtin.c
index e73a7a452..627a3b82c 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1628,10 +1628,16 @@ typeset_single(char *cname, char *pname, Param pm, int func,
 	if ((tc = chflags && chflags != (PM_EFLOAT|PM_FFLOAT)))
 	    usepm = 0;
     }
-    if (tc && (pm->flags & PM_SPECIAL)) {
-	zerrnam(cname, "%s: can't change type of a special parameter",
-		pname, 0);
-	return NULL;
+    if (tc){
+	if (pm->flags & PM_SPECIAL) {
+	    zerrnam(cname, "%s: can't change type of a special parameter",
+		    pname, 0);
+	    return NULL;
+	} else if (pm->flags & PM_AUTOLOAD) {
+	    zerrnam(cname, "%s: can't change type of autoloaded parameter",
+		    pname, 0);
+	    return NULL;
+	}
     }
 
     /*