From 82b4156ab5da52394b7415822ff455b75b5dd21f Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Tue, 4 Sep 2018 16:43:40 -0400 Subject: [PATCH] commit bash-20180831 snapshot --- CWRU/CWRU.chlog | 7 +++++++ builtins/printf.def | 4 ++++ lib/readline/text.c | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 236ee9ba..90501dd7 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -4245,3 +4245,10 @@ execute_cmd.c unfreeze_jobs_list - execute_pipeline: set up lastpipe_cleanup with old value of jobs_list_frozen + + 9/3 + --- +builtins/printf.def + - getuintmax,getfloatmax: on a conversion error, return as much of the + value as we were able to convert instead of 0. Fixes bug reported + by Robert Elz diff --git a/builtins/printf.def b/builtins/printf.def index fc089291..1f76c25f 100644 --- a/builtins/printf.def +++ b/builtins/printf.def @@ -1198,8 +1198,10 @@ getuintmax () if (*ep) { sh_invalidnum (garglist->word->word); +#if 0 /* Same POSIX.2 conversion error requirements as getintmax(). */ ret = 0; +#endif conversion_error = 1; } else if (errno == ERANGE) @@ -1227,8 +1229,10 @@ getfloatmax () if (*ep) { sh_invalidnum (garglist->word->word); +#if 0 /* Same thing about POSIX.2 conversion error requirements. */ ret = 0; +#endif conversion_error = 1; } else if (errno == ERANGE) diff --git a/lib/readline/text.c b/lib/readline/text.c index 81de2a99..15e1a51e 100644 --- a/lib/readline/text.c +++ b/lib/readline/text.c @@ -297,7 +297,7 @@ _rl_forward_char_internal (int count) #endif if (rl_end < 0) - rl_end = 0; + rl_end = 0; #else point = rl_point + count; if (point > rl_end)