From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27059 invoked by alias); 17 Nov 2012 17:37:37 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17402 Received: (qmail 22063 invoked from network); 17 Nov 2012 17:37:26 -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 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <121117093646.ZM9645@torch.brasslantern.com> Date: Sat, 17 Nov 2012 09:36:46 -0800 In-reply-to: <20121117085620.GA2500@localhost.localdomain> Comments: In reply to Han Pingtian "jobs -Z will destory environ variables" (Nov 17, 4:56pm) References: <20121117085620.GA2500@localhost.localdomain> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Han Pingtian , zsh-user Subject: Re: jobs -Z will destory environ variables MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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