[rhythmbox/wip/hadess/fix-setlocale: 1/2] shell: Fix locale initialisation




commit 5c671cea598418f5f357b5f029f409ec957941a1
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Apr 2 15:41:11 2021 +0200

    shell: Fix locale initialisation
    
    Call setlocale() with "" as the locale to initialise locale support from
    environment variables, rather than with NULL, which will return the
    current locale setting in a retval we ignore.
    
    This call has no effect on Rhythmbox when it works properly, as the
    GApplication class code will call it, but as we need to call
    setlocale() as early as possible, in case of initialisation problems.

 shell/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/shell/main.c b/shell/main.c
index 7170f29d5..1a629f6a7 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -66,7 +66,7 @@ main (int argc, char **argv)
        g_setenv ("GSETTINGS_SCHEMA_DIR", SHARE_UNINSTALLED_BUILDDIR, TRUE);
 #endif
 
-       setlocale (LC_ALL, NULL);
+       setlocale (LC_ALL, "");
 
 #ifdef ENABLE_NLS
        /* initialize i18n */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]