]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
fix for readline to handle setlocale() returning NULL
authorChet Ramey <chet.ramey@case.edu>
Fri, 7 Oct 2022 21:44:03 +0000 (17:44 -0400)
committerChet Ramey <chet.ramey@case.edu>
Fri, 7 Oct 2022 21:44:03 +0000 (17:44 -0400)
CWRU/CWRU.chlog
examples/loadables/getconf.c
lib/readline/input.c
lib/readline/nls.c
lib/readline/rlprivate.h

index c5286520f8ec76c5ebc0cf4010f68d2a9d77e373..c6db0eb5c3e2dad5bc9254d15d275e46d53026a7 100644 (file)
@@ -4020,3 +4020,13 @@ m4/strtoimax.m4
        - BASH_FUNC_STRTOIMAX: fix logic inversion of result; we should be
          replacing the function if the tests show we *don't* have a working
          version. Report from Emanuel Haupt <ehaupt@FreeBSD.org>
+
+                                  10/4
+                                  ----
+lib/readline/nls.c
+       - _rl_init_locale: cope with setlocale returning NULL, make sure we
+         set up a default value for LC_CTYPE. Report from
+         https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109
+
+lib/readline/{input.c,rlprivate.h}
+       - fixes for compiling on w64-mingw32
index 75a0a5679b73039a1db9dced6dd92598853351f5..7edfbc968dde6d533d3f77039434b604707ff488 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2021,2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <error.h>
-#include <libintl.h>
+#include <gettext.h>
 #include <locale.h>
 #include <string.h>
 #include <stdlib.h>
index 8c5d6fb65ad4284757dc1abf6663e6aadd3d7a1a..da4da45525f4ab80615dcb277b07dc3ff97cd661 100644 (file)
@@ -151,7 +151,9 @@ int rl_timeout_remaining (unsigned int *, unsigned int *);
 
 int _rl_timeout_init (void);
 int _rl_timeout_sigalrm_handler (void);
+#if defined (RL_TIMEOUT_USE_SELECT)
 int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *, const sigset_t *);
+#endif
 
 static void _rl_timeout_handle (void);
 #if defined (RL_TIMEOUT_USE_SIGALRM)
index 5c6a13b6e9ce6687b72410cf29c399215aef0003..f117cf9e6ef9601d61cabcc926725d11bb8516b7 100644 (file)
@@ -141,6 +141,10 @@ _rl_init_locale (void)
   if (lspec == 0)
     lspec = "";
   ret = setlocale (LC_CTYPE, lspec);   /* ok, since it does not change locale */
+  if (ret == 0 || *ret == 0)
+    ret = setlocale (LC_CTYPE, NULL);
+  if (ret == 0 || *ret == 0)
+    ret = RL_DEFAULT_LOCALE;
 #else
   ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
 #endif
index d87d07a72ee19c06b24338ac2f7c4ab80eb83870..fc3171aa2d15ccb0e8f60777e0ba3c3d7f110832 100644 (file)
@@ -303,7 +303,7 @@ extern int _rl_pushed_input_available (void);
 
 extern int _rl_timeout_init (void);
 extern int _rl_timeout_handle_sigalrm (void);
-#if defined (_POSIXSELECT_H_)
+#if defined (_POSIXSELECT_H_) && !defined (__MINGW32__)
 /* use as a sentinel for fd_set, struct timeval,  and sigset_t definitions */
 extern int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *, const sigset_t *);
 #endif