summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-30 13:48:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:20 -0700
commit84c7b88ccae183c236ad7ca5cdb8dd097de25420 (patch)
tree577a4bbf1ee6e20f10c3fd0065f5b3de8b54741d /doio.c
parent89a5757c96fe4f4c0a6bfec37e8037a7d311ee5a (diff)
downloadperl-84c7b88ccae183c236ad7ca5cdb8dd097de25420.tar.gz
whichsig nul-cleanup.
This adds _pv, _pvn, and _pv versions of whichsig() in mg.c, which get both kill "NAME" and %SIG lookup nul-clean.
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index 9d06cbe402..b86eac4e35 100644
--- a/doio.c
+++ b/doio.c
@@ -1567,6 +1567,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
register I32 tot = 0;
const char *const what = PL_op_name[type];
const char *s;
+ STRLEN len;
SV ** const oldmark = mark;
PERL_ARGS_ASSERT_APPLY;
@@ -1677,12 +1678,14 @@ nothing in the core.
APPLY_TAINT_PROPER();
if (mark == sp)
break;
- s = SvPVx_nolen_const(*++mark);
+ s = SvPVx_const(*++mark, len);
if (isALPHA(*s)) {
- if (*s == 'S' && s[1] == 'I' && s[2] == 'G')
+ if (*s == 'S' && s[1] == 'I' && s[2] == 'G') {
s += 3;
- if ((val = whichsig(s)) < 0)
- Perl_croak(aTHX_ "Unrecognized signal name \"%s\"",s);
+ len -= 3;
+ }
+ if ((val = whichsig_pvn(s, len)) < 0)
+ Perl_croak(aTHX_ "Unrecognized signal name \"%"SVf"\"", SVfARG(*mark));
}
else
val = SvIV(*mark);