summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 47c3c8d1b..2660e4f22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-12  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 34519: Src/exec.c: handle $_ with arguments to anonymous
+	function.
+
 2015-02-12  Barton E. Schaefer  <schaefer@zsh.org>
 
 	* 34514: Src/exec.c, Src/parse.c, Test/E01options.ztst:
diff --git a/Src/exec.c b/Src/exec.c
index 3b0e936b4..302e2b510 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)";