diff --git a/t/loc_tools.pl b/t/loc_tools.pl index f4f6200d6a1f..44b54966b3d6 100644 --- a/t/loc_tools.pl +++ b/t/loc_tools.pl @@ -175,14 +175,18 @@ ($$$$) my $result = setlocale($category, $locale); return unless defined $result; - } - if ($badutf8) { - _my_fail("Verify locale name doesn't contain malformed utf8"); - return; + no locale; + + if ($badutf8) { + _my_fail("Verify locale name doesn't contain malformed utf8"); + return; + } + + return unless $plays_well || $allow_incompatible; } - push @$list, $locale if $plays_well || $allow_incompatible; + push @$list, $locale; } sub _decode_encodings { # For use only by other functions in this file!