Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: $_ with anonymous
- X-seq: zsh-workers 34519
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: PATCH: $_ with anonymous
- Date: Thu, 12 Feb 2015 19:35:26 +0000
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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)";
Messages sorted by:
Reverse Date,
Date,
Thread,
Author