mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-04 19:00:50 +02:00
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:
+1
-1
@@ -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
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user