From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9092 invoked by alias); 18 Dec 2014 19:48:06 -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: X-Seq: 34008 Received: (qmail 15090 invoked from network); 18 Dec 2014 19:48:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [86.6.25.230] X-Spam: 0 X-Authority: v=2.1 cv=Ku/D2AmN c=1 sm=1 tr=0 a=c0CwWhpM9oUd/BnC3z6Gzg==:117 a=c0CwWhpM9oUd/BnC3z6Gzg==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=vaJtXVxTAAAA:8 a=-vBtIwVEGauwDOH3l9wA:9 a=CjuIK1q_8ugA:10 Date: Thu, 18 Dec 2014 19:47:58 +0000 From: Peter Stephenson To: zsh-workers Subject: Re: [BUG] Unicode variables can be exported and are exported metafied Message-ID: <20141218194758.329bd9ef@pws-pc.ntlworld.com> In-Reply-To: <20141218192917.4df5324b@pws-pc.ntlworld.com> References: <1054131418926765@web2o.yandex.ru> <20141218192917.4df5324b@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 18 Dec 2014 19:29:17 +0000 Peter Stephenson wrote: > On Thu, 18 Dec 2014 21:19:25 +0300 > ZyX wrote: > > but its 0x83 byte which is the last byte of the first unicode > > codepoint that forms the variable name represented as UTF-8 is using > > zsh `Meta` escape in the `env` output (which clearly is a bug assuming > > the fact that unicode variable is exported is not). > > Yes, indeed. And on import to the shell. Currently averaging two patches per fix... diff --git a/Src/params.c b/Src/params.c index b87598a..1c51afd 100644 --- a/Src/params.c +++ b/Src/params.c @@ -641,7 +641,7 @@ split_env_string(char *env, char **name, char **value) if (!env || !name || !value) return 0; - tenv = strcpy(zhalloc(strlen(env) + 1), env); + tenv = metafy(env, strlen(env), META_HEAPDUP); for (str = tenv; *str && *str != '='; str++) ; if (str != tenv && *str == '=') { pws