]> git.saurik.com Git - cydia.git/commitdiff
DHowett noticed that setenv(, NULL, ) crashes, so if there is no language set somehow...
authorJay Freeman (saurik) <saurik@saurk.com>
Sat, 28 Nov 2009 06:36:22 +0000 (06:36 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 30 Sep 2010 07:13:59 +0000 (07:13 +0000)
Cydia.mm

index 17b7512994a1921e796c3a7d35aa5db0dbad6a92..a8ed4b73743f740731b435bb2efc1bf58a4235f0 100644 (file)
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -8353,12 +8353,16 @@ int main(int argc, char *argv[]) { _pooled
     Languages_ = [NSLocale preferredLanguages];
     //CFStringRef locale(CFLocaleGetIdentifier(Locale_));
     //NSLog(@"%@", [Languages_ description]);
+
     const char *lang;
     if (Languages_ == nil || [Languages_ count] == 0)
+        // XXX: consider just setting to C and then falling through?
         lang = NULL;
-    else
+    else {
         lang = [[Languages_ objectAtIndex:0] UTF8String];
-    setenv("LANG", lang, true);
+        setenv("LANG", lang, true);
+    }
+
     //std::setlocale(LC_ALL, lang);
     NSLog(@"Setting Language: %s", lang);
     /* }}} */