about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2001-06-14 09:49:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2001-06-14 09:49:01 +0000
commitd247b7f14664f234802bdc2c205ad510e4e400d4 (patch)
treeb93c30ab897f2bde4ac0f799e65ffab870cec2b9 /Src/builtin.c
parenta5a5aa4e3e43d3e83a5aa8770f9170ea6ace6e32 (diff)
downloadzsh-d247b7f14664f234802bdc2c205ad510e4e400d4.tar.gz
zsh-d247b7f14664f234802bdc2c205ad510e4e400d4.tar.xz
zsh-d247b7f14664f234802bdc2c205ad510e4e400d4.zip
$* and $@ are special
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index ad340afc8..110a264f2 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1628,7 +1628,14 @@ typeset_single(char *cname, char *pname, Param pm, int func,
 	if ((tc = chflags && chflags != (PM_EFLOAT|PM_FFLOAT)))
 	    usepm = 0;
     }
-    if (tc){
+
+    /*
+     * Extra checks if converting the type of a parameter, or if
+     * trying to remove readonlyness.  It's dangerous doing either
+     * with a special or a parameter which isn't loaded yet (which
+     * may be special when it is loaded; we can't tell yet).
+     */
+    if (tc || ((usepm || newspecial) && (off & pm->flags & PM_READONLY))) {
 	if (pm->flags & PM_SPECIAL) {
 	    zerrnam(cname, "%s: can't change type of a special parameter",
 		    pname, 0);