allow locale's decimal point as radix character when parsing fixed-point decimal into seconds and fractional seconds; handle case of shell script file descriptor being made non-blocking; fix smalkl memory leak in programmable completion of shell option names; fix for patsub_replacement behavior when BASH_COMPAT = 42 and the replacement string is quoted; fix for readine when changing show-mode-in-prompt variable

This commit is contained in:
Chet Ramey
2025-12-17 09:59:56 -05:00
parent f27bf94a79
commit 2cdb2f9b31
12 changed files with 241 additions and 38 deletions
+1 -1
View File
@@ -1906,7 +1906,7 @@ static const struct {
{ "search-ignore-case", &_rl_search_case_fold, 0 },
{ "show-all-if-ambiguous", &_rl_complete_show_all, 0 },
{ "show-all-if-unmodified", &_rl_complete_show_unmodified, 0 },
{ "show-mode-in-prompt", &_rl_show_mode_in_prompt, 0 },
{ "show-mode-in-prompt", &_rl_show_mode_in_prompt, V_SPECIAL },
{ "skip-completed-text", &_rl_skip_completed_text, 0 },
#if defined (VISIBLE_STATS)
{ "visible-stats", &rl_visible_stats, 0 },
+12 -4
View File
@@ -1,7 +1,7 @@
/* uconvert - convert string representations of decimal numbers into whole
number/fractional value pairs. */
/* Copyright (C) 2008,2009,2020,2022 Free Software Foundation, Inc.
/* Copyright (C) 2008,2009,2020-2025 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -29,13 +29,21 @@
#include <unistd.h>
#endif
#include <bashintl.h>
#include <stdc.h>
#include <stdio.h>
#include "chartypes.h"
#include "shell.h"
#include "builtins.h"
#define DECIMAL '.' /* XXX - should use locale */
#ifndef locale_decpoint
extern int locale_decpoint (void);
#endif
#define DECIMAL '.'
#define ISRADIX(c) ((c) == DECIMAL || (c) == locale_decpoint())
#define RETURN(x) \
do { \
@@ -76,7 +84,7 @@ uconvert(const char *s, long *ip, long *up, char **ep)
for ( ; p && *p; p++)
{
if (*p == DECIMAL) /* decimal point */
if (ISRADIX (*p)) /* radix character */
break;
if (DIGIT(*p) == 0)
RETURN(0);
@@ -86,7 +94,7 @@ uconvert(const char *s, long *ip, long *up, char **ep)
if (p == 0 || *p == 0) /* callers ensure p can never be 0; this is to shut up clang */
RETURN(1);
if (*p == DECIMAL)
if (ISRADIX (*p))
p++;
/* Look for up to six digits past a decimal point. */