- if there is no LANG set this would segv. I don't know if this fix is

right, but just set LANG="en" if it isn't there.


SVN revision: 14149
This commit is contained in:
Dan Sinclair 2005-04-12 02:41:14 +00:00 committed by Dan Sinclair
parent 4e2fe1cc4d
commit 39ed7279d7
1 changed files with 84 additions and 82 deletions

View File

@ -40,6 +40,8 @@ e_intl_language_set(const char *lang)
if (_e_intl_language) free(_e_intl_language); if (_e_intl_language) free(_e_intl_language);
if (!lang) lang = getenv("LANG"); if (!lang) lang = getenv("LANG");
/* FIXME: not sure the correct fix, but currenlty segv's if LANG isn't set */
if (!lang) lang = "en";
_e_intl_language = strdup(lang); _e_intl_language = strdup(lang);
snprintf(buf, sizeof(buf), "LANG=%s", _e_intl_language); snprintf(buf, sizeof(buf), "LANG=%s", _e_intl_language);
putenv(buf); putenv(buf);