]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
kconfig/nconf: Initialize the default locale at startup
authorJakub Horký <jakub.git@horky.net>
Tue, 14 Oct 2025 14:44:06 +0000 (16:44 +0200)
committerNathan Chancellor <nathan@kernel.org>
Sat, 1 Nov 2025 04:23:22 +0000 (00:23 -0400)
Fix bug where make nconfig doesn't initialize the default locale, which
causes ncurses menu borders to be displayed incorrectly (lqqqqk) in
UTF-8 terminals that don't support VT100 ACS by default, such as PuTTY.

Signed-off-by: Jakub Horký <jakub.git@horky.net>
Link: https://patch.msgid.link/20251014144405.3975275-2-jakub.git@horky.net
[nathan: Alphabetize locale.h include]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
scripts/kconfig/nconf.c

index ae1fe5f60327039bd4cc1c0ae47ccf09f3a26add..521700ed71524069e1cfc95c56b84412745c98ec 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE
 #endif
+#include <locale.h>
 #include <string.h>
 #include <strings.h>
 #include <stdlib.h>
@@ -1478,6 +1479,8 @@ int main(int ac, char **av)
        int lines, columns;
        char *mode;
 
+       setlocale(LC_ALL, "");
+
        if (ac > 1 && strcmp(av[1], "-s") == 0) {
                /* Silence conf_read() until the real callback is set up */
                conf_set_message_callback(NULL);