This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Remove branch to label
authorKarl Williamson <khw@cpan.org>
Sun, 7 Jan 2018 22:58:52 +0000 (15:58 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 31 Jan 2018 13:33:02 +0000 (06:33 -0700)
The code at this label was branched to because it contained common
cleanup code.  But now that code is in a function, so the cleanup call
is trivial, so just skip this intermediate label.

locale.c

index b62bb05..b877f38 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -3265,7 +3265,8 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
                                        (int) MB_CUR_MAX));
             if ((unsigned) MB_CUR_MAX < STRLENs(MAX_UNICODE_UTF8)) {
                 is_utf8 = FALSE;
-                goto finish_ctype;
+                restore_switched_locale(LC_CTYPE, original_ctype_locale);
+                goto finish_and_return;
             }
 
 #    endif
@@ -3297,7 +3298,8 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
                 DEBUG_L(PerlIO_printf(Perl_debug_log,
                        "\tnllanginfo returned CODESET '%s'; ?UTF8 locale=%d\n",
                                                      codeset,         is_utf8));
-                goto finish_ctype;
+                restore_switched_locale(LC_CTYPE, original_ctype_locale);
+                goto finish_and_return;
             }
         }
 
@@ -3347,10 +3349,7 @@ Perl__is_cur_LC_category_utf8(pTHX_ int category)
                             && wc == (wchar_t) UNICODE_REPLACEMENT);
         }
 
-      finish_ctype:
-
         restore_switched_locale(LC_CTYPE, original_ctype_locale);
-
         goto finish_and_return;
     }