summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-11-30 09:53:17 -0700
committerKarl Williamson <khw@cpan.org>2016-12-23 16:48:34 -0700
commit7a2070659f99247def6a6df08dea5709c01b7877 (patch)
tree355b36caed5b5c65ed532a0c5692f511a8994f2c /pp_pack.c
parentda8c1a98236a9f56df850c47705cb3046d6636aa (diff)
downloadperl-7a2070659f99247def6a6df08dea5709c01b7877.tar.gz
Convert core (except toke.c) to use isFOO_utf8_safe()
The previous commit added this feature; now this commit uses it in core. toke.c is deferred to the next commit to aid in possible future bisecting, because some of the changes there seem somewhat more likely to expose bugs.
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pp_pack.c b/pp_pack.c
index a75229acca..ee4c69e0ae 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -1073,9 +1073,14 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c
/* 'A' strips both nulls and spaces */
const char *ptr;
if (utf8 && (symptr->flags & FLAG_WAS_UTF8)) {
- for (ptr = s+len-1; ptr >= s; ptr--)
- if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) &&
- !isSPACE_utf8(ptr)) break;
+ for (ptr = s+len-1; ptr >= s; ptr--) {
+ if ( *ptr != 0
+ && !UTF8_IS_CONTINUATION(*ptr)
+ && !isSPACE_utf8_safe(ptr, strend))
+ {
+ break;
+ }
+ }
if (ptr >= s) ptr += UTF8SKIP(ptr);
else ptr++;
if (ptr > s+len)