about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/params.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fe1156f70..d0170bae2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@
 	min(), max(), sum(), provided by a new autoloadable function
 	'zmathfunc'.
 
+2016-02-16  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 37988: Src/params.c: $0 becomes read-only under POSIXARGZERO
+
 2016-02-15  Eric Cook  <llua@gmx.com>
 
 	* 37975: Completion/Unix/Command/_php: allow completion after
diff --git a/Src/params.c b/Src/params.c
index 0233e2b00..8bd8a8eee 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -4158,7 +4158,9 @@ static void
 argzerosetfn(UNUSED(Param pm), char *x)
 {
     if (x) {
-	if (!isset(POSIXARGZERO)) {
+	if (isset(POSIXARGZERO))
+	    zerr("read-only variable: 0");
+	else {
 	    zsfree(argzero);
 	    argzero = ztrdup(x);
 	}