From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id a6eeb08c for ; Sat, 22 Jun 2019 11:55:26 +0000 (UTC) Received: (qmail 20601 invoked by alias); 22 Jun 2019 11:55:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44443 Received: (qmail 5833 invoked by uid 1010); 22 Jun 2019 11:55:15 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25482. spamassassin: 3.4.2. Clear:RC:0(37.59.109.123):SA:0(-1.9/5.0):. Processed in 1.624819 secs); 22 Jun 2019 11:55:15 -0000 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at inlv.org does not designate permitted sender hosts) Subject: Re: [PATCH] posix_builtins: allow exporting a readonly To: zsh-workers@zsh.org References: <1c9aa8c0-c8ee-564f-d351-461d4183d533@inlv.org> <1561107544.12694.12.camel@samsung.com> From: Martijn Dekker Message-ID: <0fec611f-02b3-8047-3048-30059d7256d8@inlv.org> Date: Sat, 22 Jun 2019 12:54:34 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1561107544.12694.12.camel@samsung.com> Content-Type: multipart/mixed; boundary="------------589038DBFCA6B71EB125593D" Content-Language: en-GB --------------589038DBFCA6B71EB125593D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Op 21-06-19 om 09:59 schreef Peter Stephenson: > On Thu, 2019-06-20 at 19:47 +0100, Martijn Dekker wrote: >> Op 18-04-18 om 20:58 schreef Martijn Dekker: >>> >>> POSIX_BUILTINS incorrectly prohibits exporting a readonly variable. All >>> other POSIX shells allow this and there is nothing in the POSIX text[*] >>> that says it's not allowed. The attached patch fixes this. >> This seems to have been forgotten about, so I'm trying again. >> >> To recap: >> >> $ zsh -c 'readonly foo=123; export foo' # OK >> $ zsh --emulate sh -c 'readonly foo=123; export foo' # BUG >> zsh:1: read-only variable: foo >> >> I had another look at it and I think this patch (attached) should be >> even more straightforward. > > This sounds fine but I don't think there is an attachment. Woops. :-/ Here it is... - M. --------------589038DBFCA6B71EB125593D Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="BUG_NOEXPRO.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="BUG_NOEXPRO.patch" ZGlmZiAtLWdpdCBhL1NyYy9idWlsdGluLmMgYi9TcmMvYnVpbHRpbi5jCmluZGV4IDI0NTNm ODJjMC4uZTg2M2NjNGJiIDEwMDY0NAotLS0gYS9TcmMvYnVpbHRpbi5jCisrKyBiL1NyYy9i dWlsdGluLmMKQEAgLTIxNzEsNyArMjE3MSw3IEBAIHR5cGVzZXRfc2luZ2xlKGNoYXIgKmNu YW1lLCBjaGFyICpwbmFtZSwgUGFyYW0gcG0sIFVOVVNFRChpbnQgZnVuYyksCiAJICAgICFB U0dfVkFMVUVQKGFzZykpCiAJICAgIG9uIHw9IFBNX1VOU0VUOwogCWVsc2UgaWYgKHVzZXBt ICYmIChwbS0+bm9kZS5mbGFncyAmIFBNX1JFQURPTkxZKSAmJgotCQkgIShvbiAmIFBNX1JF QURPTkxZKSkgeworCQkgIShvbiAmIFBNX1JFQURPTkxZKSAmJiBmdW5jICE9IEJJTl9FWFBP UlQpIHsKIAkgICAgemVycigicmVhZC1vbmx5IHZhcmlhYmxlOiAlcyIsIHBtLT5ub2RlLm5h bSk7CiAJICAgIHJldHVybiBOVUxMOwogCX0K --------------589038DBFCA6B71EB125593D--