From 754aa8ba79023964e085fd61b00b2e8b010c2fe4 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Thu, 30 Mar 2017 21:32:48 +0200
Subject: [PATCH] tweaks: elide a variable and a pair of braces

---
 src/nano.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/nano.c b/src/nano.c
index d0fed492..abd573ee 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1998,18 +1998,14 @@ int main(int argc, char **argv)
     tcgetattr(0, &oldterm);
 
 #ifdef ENABLE_UTF8
-    {
-	/* If the locale set exists and uses UTF-8, we should use
-	 * UTF-8. */
-	char *locale = setlocale(LC_ALL, "");
-
-	if (locale != NULL && (strcmp(nl_langinfo(CODESET),
-		"UTF-8") == 0)) {
+    /* If setting the locale is successful and it uses UTF-8, we need
+     * to use the multibyte functions for text processing. */
+    if (setlocale(LC_ALL, "") != NULL &&
+		strcmp(nl_langinfo(CODESET), "UTF-8") == 0) {
 #ifdef USE_SLANG
-	    SLutf8_enable(1);
+	SLutf8_enable(1);
 #endif
-	    utf8_init();
-	}
+	utf8_init();
     }
 #else
     setlocale(LC_ALL, "");
-- 
GitLab