mirror of
https://github.com/vim/vim.git
synced 2025-11-08 10:27:32 -05:00
patch 9.0.1196: code is indented more than necessary
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11813)
This commit is contained in:
committed by
Bram Moolenaar
parent
378e6c03f9
commit
e857598896
47
src/locale.c
47
src/locale.c
@@ -151,20 +151,20 @@ get_mess_env(void)
|
||||
char_u *p;
|
||||
|
||||
p = mch_getenv((char_u *)"LC_ALL");
|
||||
if (p == NULL || *p == NUL)
|
||||
{
|
||||
p = mch_getenv((char_u *)"LC_MESSAGES");
|
||||
if (p == NULL || *p == NUL)
|
||||
{
|
||||
p = mch_getenv((char_u *)"LANG");
|
||||
if (p != NULL && VIM_ISDIGIT(*p))
|
||||
p = NULL; // ignore something like "1043"
|
||||
if (p != NULL && *p != NUL)
|
||||
return p;
|
||||
|
||||
p = mch_getenv((char_u *)"LC_MESSAGES");
|
||||
if (p != NULL && *p != NUL)
|
||||
return p;
|
||||
|
||||
p = mch_getenv((char_u *)"LANG");
|
||||
if (p != NULL && VIM_ISDIGIT(*p))
|
||||
p = NULL; // ignore something like "1043"
|
||||
# ifdef HAVE_GET_LOCALE_VAL
|
||||
if (p == NULL || *p == NUL)
|
||||
p = get_locale_val(LC_CTYPE);
|
||||
if (p == NULL || *p == NUL)
|
||||
p = get_locale_val(LC_CTYPE);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
@@ -504,11 +504,11 @@ find_locales(void)
|
||||
static void
|
||||
init_locales(void)
|
||||
{
|
||||
if (!did_init_locales)
|
||||
{
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
if (did_init_locales)
|
||||
return;
|
||||
|
||||
did_init_locales = TRUE;
|
||||
locales = find_locales();
|
||||
}
|
||||
|
||||
# if defined(EXITFREE) || defined(PROTO)
|
||||
@@ -516,12 +516,13 @@ init_locales(void)
|
||||
free_locales(void)
|
||||
{
|
||||
int i;
|
||||
if (locales != NULL)
|
||||
{
|
||||
for (i = 0; locales[i] != NULL; i++)
|
||||
vim_free(locales[i]);
|
||||
VIM_CLEAR(locales);
|
||||
}
|
||||
|
||||
if (locales == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; locales[i] != NULL; i++)
|
||||
vim_free(locales[i]);
|
||||
VIM_CLEAR(locales);
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user