diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index c5286520..c6db0eb5 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -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 + + 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 diff --git a/examples/loadables/getconf.c b/examples/loadables/getconf.c index 75a0a567..7edfbc96 100644 --- a/examples/loadables/getconf.c +++ b/examples/loadables/getconf.c @@ -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 #include #include -#include +#include #include #include #include diff --git a/lib/readline/input.c b/lib/readline/input.c index 8c5d6fb6..da4da455 100644 --- a/lib/readline/input.c +++ b/lib/readline/input.c @@ -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) diff --git a/lib/readline/nls.c b/lib/readline/nls.c index 5c6a13b6..f117cf9e 100644 --- a/lib/readline/nls.c +++ b/lib/readline/nls.c @@ -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 diff --git a/lib/readline/rlprivate.h b/lib/readline/rlprivate.h index d87d07a7..fc3171aa 100644 --- a/lib/readline/rlprivate.h +++ b/lib/readline/rlprivate.h @@ -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