diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-08-23 01:53:04 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-08-23 01:53:04 +0000 |
commit | 593ed51550a14c6ccbcbc279b899e4ba2100f94a (patch) | |
tree | 9e6d32ca0c5ba19cf047965bd1b18e27683c7e71 /libsylph | |
parent | 1af4d68a52c15c008b3e9d50d21348d509dd0c26 (diff) |
conv_get_current_locale(): fixed the case when cur_locale is null string.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1881 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/codeconv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c index 13de2baf..6132d806 100644 --- a/libsylph/codeconv.c +++ b/libsylph/codeconv.c @@ -2054,9 +2054,12 @@ const gchar *conv_get_current_locale(void) cur_locale = g_win32_getlocale(); #else cur_locale = g_getenv("LC_ALL"); - if (!cur_locale) cur_locale = g_getenv("LC_CTYPE"); - if (!cur_locale) cur_locale = g_getenv("LANG"); - if (!cur_locale) cur_locale = setlocale(LC_CTYPE, NULL); + if (!cur_locale || *cur_locale == '\0') + cur_locale = g_getenv("LC_CTYPE"); + if (!cur_locale || *cur_locale == '\0') + cur_locale = g_getenv("LANG"); + if (!cur_locale || *cur_locale == '\0') + cur_locale = setlocale(LC_CTYPE, NULL); #endif /* G_OS_WIN32 */ debug_print("current locale: %s\n", |