From: Nicholas Clark Date: Fri, 9 Sep 2011 16:15:00 +0000 (+0200) Subject: When probing strxfrm, consider a consistent return value of 0 as sane X-Git-Tag: v5.15.3~175 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/e0601d3cce2506893b3816f3ef18eaeff16f5062 When probing strxfrm, consider a consistent return value of 0 as sane --- diff --git a/locale.c b/locale.c index 5893212..81c09ab 100644 --- a/locale.c +++ b/locale.c @@ -231,7 +231,7 @@ Perl_new_collate(pTHX_ const char *newcoll) const Size_t fa = strxfrm(xbuf, "a", XFRMBUFSIZE); const Size_t fb = strxfrm(xbuf, "ab", XFRMBUFSIZE); const SSize_t mult = fb - fa; - if (mult < 1) + if (mult < 1 && !(fa == 0 && fb == 0)) Perl_croak(aTHX_ "panic: strxfrm() gets absurd - a => %"UVuf", ab => %"UVuf, (UV) fa, (UV) fb); PL_collxfrm_base = (fa > (Size_t)mult) ? (fa - mult) : 0;