diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-30 13:48:58 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:20 -0700 |
commit | 84c7b88ccae183c236ad7ca5cdb8dd097de25420 (patch) | |
tree | 577a4bbf1ee6e20f10c3fd0065f5b3de8b54741d /doio.c | |
parent | 89a5757c96fe4f4c0a6bfec37e8037a7d311ee5a (diff) | |
download | perl-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.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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); |