summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 034e2ae9f..14aadf2e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-06-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* Martijn: 44443: Src/builtin.c: POSIX allows exporting readonly
+	variables.
+
 2019-06-20  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 44435: Doc/Zsh/expn.yo, NEWS, README, Src/Zle/compctl.c,
diff --git a/Src/builtin.c b/Src/builtin.c
index 2453f82c0..e863cc4bb 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2171,7 +2171,7 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
 	    !ASG_VALUEP(asg))
 	    on |= PM_UNSET;
 	else if (usepm && (pm->node.flags & PM_READONLY) &&
-		 !(on & PM_READONLY)) {
+		 !(on & PM_READONLY) && func != BIN_EXPORT) {
 	    zerr("read-only variable: %s", pm->node.nam);
 	    return NULL;
 	}