This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mg.c: Convert to use is_utf8_non_invariant_string()
authorKarl Williamson <khw@cpan.org>
Sat, 18 Nov 2017 21:16:26 +0000 (14:16 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 26 Nov 2017 17:19:46 +0000 (10:19 -0700)
mg.c

diff --git a/mg.c b/mg.c
index fe07755..64e450f 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -824,9 +824,8 @@ S_fixup_errno_string(pTHX_ SV* sv)
          * (http://en.wikipedia.org/wiki/Charset_detection).  There is a
          * potential that we will get it wrong however, especially on short
          * error message text, so do an additional check. */
-        if (   ! IN_BYTES  /* respect 'use bytes' */
-            && ! is_utf8_invariant_string((U8*) SvPVX_const(sv), SvCUR(sv))
-            &&   is_utf8_string((U8*) SvPVX_const(sv), SvCUR(sv))
+        if ( ! IN_BYTES  /* respect 'use bytes' */
+            && is_utf8_non_invariant_string((U8*) SvPVX_const(sv), SvCUR(sv))
 
 #ifdef USE_LOCALE_MESSAGES