diff options
-rw-r--r-- | doop.c | 2 | ||||
-rw-r--r-- | t/op/gmagic.t | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -1033,7 +1033,7 @@ Perl_do_chop(pTHX_ register SV *astr, register SV *sv) s = SvPV(sv, len); if (len && !SvPOK(sv)) - s = SvPV_force(sv, len); + s = SvPV_force_nomg(sv, len); if (DO_UTF8(sv)) { if (s && len) { char * const send = s + len; diff --git a/t/op/gmagic.t b/t/op/gmagic.t index ab6d2ee3e6..ce05aff906 100644 --- a/t/op/gmagic.t +++ b/t/op/gmagic.t @@ -6,7 +6,7 @@ BEGIN { @INC = '../lib'; } -print "1..18\n"; +print "1..20\n"; my $t = 1; tie my $c => 'Tie::Monitor'; @@ -50,6 +50,10 @@ ok_string($s, 'x0', 2, 1); $s = $c = $c . $c; ok_string($s, '00', 3, 1); +# multiple magic in core functions +$s = chop($c); +ok_string($s, '0', 1, 1); + # adapted from Tie::Counter by Abigail package Tie::Monitor; |