[tools] testbot/SetwinLocale: Tweak the --country checks and conversion.

Francois Gouget fgouget at codeweavers.com
Mon Jan 3 09:10:55 CST 2022


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/SetWinLocale | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testbot/bin/SetWinLocale b/testbot/bin/SetWinLocale
index e7ae3c0ced..8360c76840 100755
--- a/testbot/bin/SetWinLocale
+++ b/testbot/bin/SetWinLocale
@@ -397,19 +397,19 @@ if (!defined $Usage)
   $OptLocale ||= $OptDefault;
   $OptSystem ||= $OptDefault;
   $OptMUI ||= $OptDefault;
-  if (!defined $OptCountry and defined $OptDefault and
-      $OptDefault =~ /-([A-Z]{2})$/)
+
+  if (!$OptCountry and ($OptDefault || "") =~ /-([A-Z]{2})$/)
   {
     $OptCountry = $1;
   }
-  if (defined $OptCountry)
+  if ($OptCountry)
   {
-    if (!exists $Countries{$OptCountry})
+    $CountryId = $Countries{$OptCountry};
+    if (!defined $CountryId)
     {
       Error("unknown country '$OptCountry'\n");
       $Usage = 2;
     }
-    $CountryId = $Countries{$OptCountry};
   }
 
   if (!$OptLocale and !$OptSystem and !$OptMUI and !$OptKeyboard and
-- 
2.30.2




More information about the wine-devel mailing list