+2014-07-19 Eli Zaretskii <eliz@gnu.org>
+
+ localename: Enforce declarations before statements.
+ * localename.c (gl_locale_name_thread): Declare 'lcid' before the
+ first statement.
+
2014-07-18 Jim Meyering <meyering@fb.com>
test-userspec: don't look up numeric user names
if (LC_MIN <= category && category <= LC_MAX)
{
char *locname = setlocale (category, NULL);
+ LCID lcid = 0;
/* If CATEGORY is LC_ALL, the result might be a semi-colon
separated list of locales. We need only one, so we take the
if (strchr (locname, ';'))
locname = setlocale (LC_CTYPE, NULL);
- /* Convert locale name to LCID. We don't want to use
- LocaleNameToLCID because (a) it is only available since Vista,
- and (b) it doesn't accept locale names returned by 'setlocale'. */
- LCID lcid = get_lcid (locname);
+ /* Convert locale name to LCID. We don't want to use
+ LocaleNameToLCID because (a) it is only available since Vista,
+ and (b) it doesn't accept locale names returned by 'setlocale'. */
+ lcid = get_lcid (locname);
- if (lcid > 0)
- return gl_locale_name_from_win32_LCID (lcid);
- }
+ if (lcid > 0)
+ return gl_locale_name_from_win32_LCID (lcid);
+ }
#endif
return NULL;
}