summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-25 18:12:35 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-25 23:02:10 -0700
commit8af2014272725e01526eb3ee0e591a9460cc770f (patch)
tree9bb3ec56b55df175f8616e380a6875ff1612a29c /pp_sys.c
parent9d3c658e5c246089e541ed0d652aaccf018f16e9 (diff)
downloadperl-8af2014272725e01526eb3ee0e591a9460cc770f.tar.gz
&CORE::getpgrp()
This commit allows &CORE::getpgrp to be called through references and via ampersand syntax. pp_getpgrp is modified to take into account the nulls pushed on to the stack in pp_coreargs, since pp_coreargs has no other way to tell getpgrp how many arguments it’s actually getting.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 704e581a8f..231388f21a 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4319,7 +4319,8 @@ PP(pp_getpgrp)
#ifdef HAS_GETPGRP
dVAR; dSP; dTARGET;
Pid_t pgrp;
- const Pid_t pid = (MAXARG < 1) ? 0 : SvIVx(POPs);
+ const Pid_t pid =
+ (MAXARG < 1) ? 0 : TOPs ? SvIVx(POPs) : ((void)POPs, 0);
#ifdef BSD_GETPGRP
pgrp = (I32)BSD_GETPGRP(pid);