tweaks: elide a variable and a pair of braces
parent
53cea142e0
commit
754aa8ba79
12
src/nano.c
12
src/nano.c
|
@ -1998,19 +1998,15 @@ int main(int argc, char **argv)
|
||||||
tcgetattr(0, &oldterm);
|
tcgetattr(0, &oldterm);
|
||||||
|
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
{
|
/* If setting the locale is successful and it uses UTF-8, we need
|
||||||
/* If the locale set exists and uses UTF-8, we should use
|
* to use the multibyte functions for text processing. */
|
||||||
* UTF-8. */
|
if (setlocale(LC_ALL, "") != NULL &&
|
||||||
char *locale = setlocale(LC_ALL, "");
|
strcmp(nl_langinfo(CODESET), "UTF-8") == 0) {
|
||||||
|
|
||||||
if (locale != NULL && (strcmp(nl_langinfo(CODESET),
|
|
||||||
"UTF-8") == 0)) {
|
|
||||||
#ifdef USE_SLANG
|
#ifdef USE_SLANG
|
||||||
SLutf8_enable(1);
|
SLutf8_enable(1);
|
||||||
#endif
|
#endif
|
||||||
utf8_init();
|
utf8_init();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue