From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: PATCH: $_ with anonymous
Date: Thu, 12 Feb 2015 19:35:26 +0000 [thread overview]
Message-ID: <20150212193526.65fb73b5@ntlworld.com> (raw)
This bit looks straightforward if we're not going to be clever (and
we're not).
As I said, this is entirely separate from the other issues.
pws
diff --git a/Src/exec.c b/Src/exec.c
index 3b0e936..302e2b5 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4456,7 +4456,7 @@ execfuncdef(Estate state, Eprog redir_prog)
if (!names) {
/*
* Anonymous function, execute immediately.
- * Function name is "(anon)", parameter list is empty.
+ * Function name is "(anon)".
*/
LinkList args;
@@ -4477,6 +4477,9 @@ execfuncdef(Estate state, Eprog redir_prog)
}
}
+ setunderscore((args && nonempty(args)) ?
+ ((char *) getdata(lastnode(args))) : "");
+
if (!args)
args = newlinklist();
shf->node.nam = "(anon)";
reply other threads:[~2015-02-12 19:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20150212193526.65fb73b5@ntlworld.com \
--to=p.w.stephenson@ntlworld.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).