From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id JAA21757 for ; Thu, 27 Jun 1996 09:31:10 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id TAA16538; Wed, 26 Jun 1996 19:25:11 -0400 (EDT) Resent-Date: Wed, 26 Jun 1996 19:25:11 -0400 (EDT) Message-Id: Subject: beta21; Bug in execcmd() and job text question To: zsh-workers@math.gatech.edu Date: Thu, 27 Jun 1996 01:25:19 +0200 (MET DST) From: Thorsten Meinecke Organization: none. Location: Berlin, Germany X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"CblNk3.0.K24.MRSqn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1449 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 1) Whoa! % ls =() zsh: parse error in process substitution zsh: segmentation fault ../../zsh-RCS-b21/Src/zsh -f This happens in getjobtext(), after the argument of the command was nuked in prefork(). 2) I can see why getjobtext() was moved behind prefork() by the recent reconstruction in this area. But why can't the original, that is unsub- stituted job text be kept when the command was a simple command? For example, no problem with this... % setopt shwordsplit; foo="sleep 10" % $foo& jobs [1] 850 [1] + running sleep 10 ...but wouldn't it be better to say `eval $foo' in the example below? % eval $foo& jobs [1] 884 [1] + running eval sleep 10 Unless I'm missing something obvious, the patch below might fix both. Regards, --Thorsten *** exec.c 1996/06/25 07:34:03 2.37 --- exec.c 1996/06/26 22:00:14 *************** *** 1165,1170 **** --- 1165,1176 ---- } } + /* Get the text associated with this command. */ + if (jobbing || (how & Z_TIMED)) + text = getjobtext((void *) cmd); + else + text = NULL; + /* Do prefork substitutions */ prefork(args, (((type == CCASE) ? 4 : 0) | (assign ? 2 : isset(MAGICEQUALSUBST)))); *************** *** 1252,1262 **** } } ! /* Get the text associated with this command. */ ! if (jobbing || (how & Z_TIMED)) text = getjobtext((void *) cmd); - else - text = NULL; /* Set up special parameter $_ */ zsfree(underscore); --- 1258,1266 ---- } } ! /* Update the text for this command if it was not a simple one. */ ! if (!errflag && !checked && (jobbing || (how & Z_TIMED))) text = getjobtext((void *) cmd); /* Set up special parameter $_ */ zsfree(underscore);