Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] Unicode variables can be exported and are exported metafied



On Thu, 18 Dec 2014 19:29:17 +0000
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Thu, 18 Dec 2014 21:19:25 +0300
> ZyX <kp-pav@xxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author