← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~paul-lucas/zorba/pjl-misc into lp:zorba

 

Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/pjl-misc into lp:zorba.

Commit message:
Now always initializing country and lang.

Requested reviews:
  Paul J. Lucas (paul-lucas)

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/189518

Now always initializing country and lang.
-- 
https://code.launchpad.net/~paul-lucas/zorba/pjl-misc/+merge/189518
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/util/locale.cpp'
--- src/util/locale.cpp	2013-08-02 18:31:23 +0000
+++ src/util/locale.cpp	2013-10-06 23:51:23 +0000
@@ -1310,15 +1310,15 @@
 }
 
 iso3166_1::type get_host_country() {
-  iso3166_1::type country;
+  iso3166_1::type country = iso3166_1::unknown;
 
-#   ifdef WIN32
+#ifdef WIN32
   zstring const name( get_locale_info( LOCALE_SISO3166CTRYNAME ) );
   country = iso3166_1::find( name );
-#   else
+#else
   zstring const loc_info( get_unix_locale() );
   parse( loc_info, nullptr, &country );
-#   endif /* WIN32 */
+#endif /* WIN32 */
 
   return country;
 }
@@ -1328,15 +1328,15 @@
   // ICU's Locale::getDefault().getLanguage() should be used here, but it
   // sometimes returns "root" which isn't useful.
   //
-  iso639_1::type lang;
+  iso639_1::type lang = iso639_1::unknown;
 
-#   ifdef WIN32
+#ifdef WIN32
   zstring const name( get_locale_info( LOCALE_SISO639LANGNAME ) );
   lang = find_lang( name );
-#   else
+#else
   zstring const loc_info( get_unix_locale() );
   parse( loc_info, &lang );
-#   endif /* WIN32 */
+#endif /* WIN32 */
   if ( !lang )
     lang = iso639_1::en;              // default to English
   


Follow ups