summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorTassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>2003-09-04 13:13:41 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-09-07 12:44:33 +0000
commit4c90a460cdb7d8d7e800ddcf78d3a123f45708a6 (patch)
tree240125f696f1fa4a602917cfdd82e8f2825b83c0 /pp_ctl.c
parenta85f0137af09e176703c3be028b101450672ebb0 (diff)
downloadperl-4c90a460cdb7d8d7e800ddcf78d3a123f45708a6.tar.gz
honoring void context for map()
Message-id: <20030904091341.GA30655@ethan> p4raw-id: //depot/perl@21062
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 1fd6e01d38..3339548619 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -893,6 +893,7 @@ PP(pp_mapstart)
PP(pp_mapwhile)
{
dSP;
+ I32 gimme = GIMME_V;
I32 items = (SP - PL_stack_base) - *PL_markstack_ptr; /* how many new items */
I32 count;
I32 shift;
@@ -903,7 +904,7 @@ PP(pp_mapwhile)
++PL_markstack_ptr[-1];
/* if there are new items, push them into the destination list */
- if (items) {
+ if (items && gimme != G_VOID) {
/* might need to make room back there first */
if (items > PL_markstack_ptr[-1] - PL_markstack_ptr[-2]) {
/* XXX this implementation is very pessimal because the stack
@@ -947,7 +948,6 @@ PP(pp_mapwhile)
/* All done yet? */
if (PL_markstack_ptr[-1] > *PL_markstack_ptr) {
- I32 gimme = GIMME_V;
(void)POPMARK; /* pop top */
LEAVE; /* exit outer scope */