forked from aniani/vim
patch 9.0.1208: 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 #11819)
This commit is contained in:
committed by
Bram Moolenaar
parent
450c7a97d1
commit
a41e221935
@@ -568,28 +568,28 @@ mac_utf8_to_utf16(
|
||||
void
|
||||
mac_lang_init(void)
|
||||
{
|
||||
if (mch_getenv((char_u *)"LANG") == NULL)
|
||||
{
|
||||
char buf[50];
|
||||
if (mch_getenv((char_u *)"LANG") != NULL)
|
||||
return;
|
||||
|
||||
// $LANG is not set, either because it was unset or Vim was started
|
||||
// from the Dock. Query the system locale.
|
||||
if (LocaleRefGetPartString(NULL,
|
||||
kLocaleLanguageMask | kLocaleLanguageVariantMask |
|
||||
kLocaleRegionMask | kLocaleRegionVariantMask,
|
||||
sizeof(buf) - 10, buf) == noErr && *buf)
|
||||
{
|
||||
if (strcasestr(buf, "utf-8") == NULL)
|
||||
strcat(buf, ".UTF-8");
|
||||
vim_setenv((char_u *)"LANG", (char_u *)buf);
|
||||
char buf[50];
|
||||
|
||||
// $LANG is not set, either because it was unset or Vim was started
|
||||
// from the Dock. Query the system locale.
|
||||
if (LocaleRefGetPartString(NULL,
|
||||
kLocaleLanguageMask | kLocaleLanguageVariantMask |
|
||||
kLocaleRegionMask | kLocaleRegionVariantMask,
|
||||
sizeof(buf) - 10, buf) == noErr && *buf)
|
||||
{
|
||||
if (strcasestr(buf, "utf-8") == NULL)
|
||||
strcat(buf, ".UTF-8");
|
||||
vim_setenv((char_u *)"LANG", (char_u *)buf);
|
||||
# ifdef HAVE_LOCALE_H
|
||||
setlocale(LC_ALL, "");
|
||||
setlocale(LC_ALL, "");
|
||||
# endif
|
||||
# if defined(LC_NUMERIC)
|
||||
// Make sure strtod() uses a decimal point, not a comma.
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
// Make sure strtod() uses a decimal point, not a comma.
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
# endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // MACOS_CONVERT
|
||||
|
Reference in New Issue
Block a user