From: Thorsten Meinecke <kaefer@aglaia.snafu.DE>
To: zsh-workers@math.gatech.edu
Subject: beta21; Bug in execcmd() and job text question
Date: Thu, 27 Jun 1996 01:25:19 +0200 (MET DST) [thread overview]
Message-ID: <m0uZ3xY-00000TC@aglaia.snafu.DE> (raw)
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);
next reply other threads:[~1996-06-26 23:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-26 23:25 Thorsten Meinecke [this message]
[not found] ` <kaefer@aglaia.snafu.DE>
1996-06-27 0:37 ` Bart Schaefer
1996-06-27 0:46 ` Zefram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m0uZ3xY-00000TC@aglaia.snafu.DE \
--to=kaefer@aglaia.snafu.de \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).