1
0
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:
Yegappan Lakshmanan
2023-01-16 18:19:05 +00:00
committed by Bram Moolenaar
parent 450c7a97d1
commit a41e221935
12 changed files with 1318 additions and 1312 deletions

View File

@@ -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