about summary refs log tree commit diff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-06-22 20:57:14 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-06-22 20:57:14 +0000
commit12fd5d0065f64f0fae54d335624b4cb10e2832b9 (patch)
tree6155027ed5a36edf973d5baed42c87acc2ca0dbd /Src/builtin.c
parent122e46b406f57712158651d8f559f52bbd3227e1 (diff)
downloadzsh-12fd5d0065f64f0fae54d335624b4cb10e2832b9.tar.gz
zsh-12fd5d0065f64f0fae54d335624b4cb10e2832b9.tar.xz
zsh-12fd5d0065f64f0fae54d335624b4cb10e2832b9.zip
12040: typeset -r bug
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 8ea88862f..90c82c06e 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1622,7 +1622,7 @@ typeset_single(char *cname, char *pname, Param pm, int func,
 		    arrfixenv(pm->nam, x);
 	    }
 	}
-	pm->flags = (pm->flags | on) & ~(off | PM_UNSET);
+	pm->flags = (pm->flags | (on & ~PM_READONLY)) & ~(off | PM_UNSET);
 	/* This auxlen/pm->ct stuff is a nasty hack. */
 	if ((on & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z | PM_INTEGER |
 		   PM_EFLOAT | PM_FFLOAT)) &&
@@ -1643,6 +1643,7 @@ typeset_single(char *cname, char *pname, Param pm, int func,
 	    zwarnnam(cname, "can't assign new value for array %s", pname, 0);
 	    return NULL;
 	}
+	pm->flags |= (on & PM_READONLY);
 	return pm;
     }