From f1f8fd6121eab70f23abb94dee8a7da178383c92 Mon Sep 17 00:00:00 2001 From: Chip Salzenberg Date: Fri, 20 Jul 2012 22:13:12 -0700 Subject: [PATCH] in sv_chop(), add use SvPOK_only_UTF8() to clear obsolete NIOK --- sv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sv.c b/sv.c index 25de4ac..2d5444e 100644 --- a/sv.c +++ b/sv.c @@ -4855,9 +4855,10 @@ Perl_sv_force_normal_flags(pTHX_ register SV *const sv, const U32 flags) =for apidoc sv_chop Efficient removal of characters from the beginning of the string buffer. -SvPOK(sv) must be true and the C must be a pointer to somewhere inside -the string buffer. The C becomes the first character of the adjusted -string. Uses the "OOK hack". +SvPOK(sv), or at least SvPOKp(sv), must be true and the C must be a +pointer to somewhere inside the string buffer. The C becomes the first +character of the adjusted string. Uses the "OOK hack". On return, only +SvPOK(sv) and SvPOKp(sv) among the OK flags will be true. Beware: after this function returns, C and SvPVX_const(sv) may no longer refer to the same chunk of data. @@ -4896,6 +4897,7 @@ Perl_sv_chop(pTHX_ register SV *const sv, register const char *const ptr) ptr, SvPVX_const(sv), SvPVX_const(sv) + max_delta); /* SvPVX(sv) may move in SV_CHECK_THINKFIRST(sv), so don't use ptr any more */ SV_CHECK_THINKFIRST(sv); + SvPOK_only_UTF8(sv); if (!SvOOK(sv)) { if (!SvLEN(sv)) { /* make copy of shared string */ -- 2.7.4