From: Peter Stephenson <pws@csr.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: Can't trace script not in PATH
Date: Mon, 15 Mar 2010 15:30:42 +0000 [thread overview]
Message-ID: <20100315153042.6bfa14c7@news01> (raw)
In-Reply-To: <20100315125923.63a6afa6@news01>
On Mon, 15 Mar 2010 12:59:23 +0000
Peter Stephenson <pws@csr.com> wrote:
> if (*argv) {
> if (unset(SHINSTDIN)) {
> if (!cmd)
> - SHIN = movefd(open(unmeta(*argv), O_RDONLY | O_NOCTTY));
> - if (SHIN == -1) {
> - zerr("can't open input file: %s", *argv);
> - exit(127);
> - }
> + *runscript = *argv;
> opts[INTERACTIVE] &= 1;
> - argzero = *argv;
> - scriptfilename = argzero;
> argv++;
> }
one more issue here... we should set argzero ($0) at this point if cmd is
set since we won't execute the code for *runscript non-NULL. This affects
zsh -c 'echo $0' foo
where time-honoured (well, time-somethinged anyway) behaviour is that $0
returns "foo". I'll add a test for this, too.
I don't think it's right to set scriptfilename in this case (i.e. -c,
obviously we set it if there's a real script), however. It's used for
debugging and it's just confusing to have the debug output look like it's
running a script it isn't.
--
Peter Stephenson <pws@csr.com> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
next prev parent reply other threads:[~2010-03-15 15:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <38D4FA2BB99A674BADDED237051D97A70EE02067@FFBRUE001.cfmu.corp.eurocontrol.int>
2010-03-15 12:59 ` Peter Stephenson
2010-03-15 14:03 ` Peter Stephenson
2010-03-15 15:30 ` Peter Stephenson [this message]
2010-08-23 13:27 ` Mikael Magnusson
2010-08-23 13:41 ` Peter Stephenson
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=20100315153042.6bfa14c7@news01 \
--to=pws@csr.com \
--cc=zsh-workers@zsh.org \
/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).