From 77d578451ced6f06e7f66fb779102746d0995338 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 18 Dec 2012 11:04:00 +0000 Subject: [PATCH] fix retrieving locale parts if region is not present SVN revision: 81233 --- src/bin/e_intl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index 9b87a37b0..107b7171a 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -624,7 +624,7 @@ e_intl_locale_parts_get(const char *locale) /* Parse Results */ E_Locale_Parts *locale_parts; char language[4]; - char territory[4]; + char territory[4] = {0}; char codeset[32]; char modifier[32]; @@ -655,6 +655,12 @@ e_intl_locale_parts_get(const char *locale) } else if ((tmp_idx < 2) && (islower(locale_char))) language[tmp_idx++] = locale_char; + else if (locale_char == '.') // no territory + { + state = 2; + language[tmp_idx] = 0; + tmp_idx = 0; + } else return NULL; break;