summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2009-11-28 06:36:22 +0000
committerJay Freeman (saurik) <saurik@saurik.com>2010-09-30 07:13:59 +0000
commit78430d06eb6b1cd28fa8bcef3396f4973ba6d72c (patch)
treeb44c95b04bc4150e064457325849390027a9dd3e
parent9b73bcf87a0bc532980dea5c0857142a7424aa69 (diff)
DHowett noticed that setenv(, NULL, ) crashes, so if there is no language set somehow I need to not try to force the issue.
-rw-r--r--Cydia.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Cydia.mm b/Cydia.mm
index 17b7512..a8ed4b7 100644
--- 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);
/* }}} */