From 85e0f0f0eb2f46e606b76a6722f843998a7e8e7c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 28 Nov 2009 06:36:22 +0000 Subject: [PATCH] DHowett noticed that setenv(, NULL, ) crashes, so if there is no language set somehow I need to not try to force the issue. --- Cydia.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Cydia.mm b/Cydia.mm index 17b75129..a8ed4b73 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); /* }}} */ -- 2.45.2