Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: jobs -Z will destory environ variables
- X-seq: zsh-users 17402
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>, zsh-user <zsh-users@xxxxxxx>
- Subject: Re: jobs -Z will destory environ variables
- Date: Sat, 17 Nov 2012 09:36:46 -0800
- In-reply-to: <20121117085620.GA2500@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20121117085620.GA2500@localhost.localdomain>
On Nov 17, 4:56pm, Han Pingtian wrote:
}
} Looks like "jobs -Z new_name" will destory the environ of current zsh.
Hmm, this is a new bug. It works (or at least doesn't destroy the
environment) in 4.2.x even on hosts where it fails in 5.0.
Which means it's not directly related to the hackzero code in bin_fg,
but must instead be related to changes in the handling of the environ
strings themselves -- probably the introduction of setenv / unsetenv
for environment management where previously it was always copied to
new memory space.
So what we need is likely this:
Index: Src/jobs.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/jobs.c,v
retrieving revision 1.92
diff -u -r1.92 jobs.c
--- Src/jobs.c 11 Oct 2012 16:36:14 -0000 1.92
+++ Src/jobs.c 17 Nov 2012 17:35:45 -0000
@@ -1743,12 +1743,14 @@
goto done;
p = strchr(q, 0);
}
+#if !defined(HAVE_PUTENV) && !defined(USE_SET_UNSET_ENV)
for(; *envp; envp++) {
q = *envp;
if(q != p+1)
goto done;
p = strchr(q, 0);
}
+#endif
done:
hackspace = p - hackzero;
#endif
Messages sorted by:
Reverse Date,
Date,
Thread,
Author