diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2009-11-28 06:36:22 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:13:59 +0000 |
commit | 78430d06eb6b1cd28fa8bcef3396f4973ba6d72c (patch) | |
tree | b44c95b04bc4150e064457325849390027a9dd3e | |
parent | 9b73bcf87a0bc532980dea5c0857142a7424aa69 (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.mm | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); /* }}} */ |