mirror of
https://github.com/mirror/make.git
synced 2026-08-19 08:23:28 +08:00
[SV 65448] intcmp: Compare values instead of magnitudes
* src/function.c (func_intcmp): Reverse comparison direction when both arguments are negative. * tests/scripts/functions/intcmp: Add tests and remove useless ones.
This commit is contained in:
committed by
Paul Smith
parent
21a538ce8f
commit
bfbf169b63
@@ -1328,6 +1328,8 @@ func_intcmp (char *o, char **argv, const char *funcname UNUSED)
|
||||
cmp = (llen > rlen) - (llen < rlen);
|
||||
if (cmp == 0)
|
||||
cmp = memcmp (lnum, rnum, llen);
|
||||
if (lsign < 0)
|
||||
cmp *= -1;
|
||||
}
|
||||
|
||||
argv += 2;
|
||||
|
||||
Reference in New Issue
Block a user