zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: $_ with anonymous
@ 2015-02-12 19:35 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2015-02-12 19:35 UTC (permalink / raw)
  To: Zsh hackers list

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)";


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-12 19:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-12 19:35 PATCH: $_ with anonymous Peter Stephenson

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).