On 10/22/22 2:58 PM, izabera wrote:
if the argument is in the (-1, 0) range, the integer part is zero and
multiplying it by -1 has no effect, so the caller can't tell that the
argument was negative

I suggest that a considerably easier way to solve this is

*** ../bash-5.2-patched/lib/sh/uconvert.c       2020-06-04 12:28:58.000000000 
-0400
--- lib/sh/uconvert.c   2022-10-24 14:50:15.000000000 -0400
***************
*** 41,45 ****
  do { \
    if (ip) *ip = ipart * mult; \
!   if (up) *up = upart; \
    if (ep) *ep = p; \
    return (x); \
--- 41,45 ----
  do { \
    if (ip) *ip = ipart * mult; \
!   if (up) *up = upart * (ipart == 0 ? mult : 1); \
    if (ep) *ep = p; \
    return (x); \


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to