You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
uriparser/uriparser-bug24.patch

35 lines
880 B

testRangeComparison() in test/test.cpp assumes that strncmp() used by uriCompareRangeA() will always return -1/0/1 values.
So it fails on AArch64:
UriSuite: 50/52
Comparing to yields -64, expected -1.
Comparing to yields 64, expected 1.
UriSuite: 51/52
Why? Simple. C standard says that strncmp() has to return <0/0/>0 values.
Upstream bug: https://sourceforge.net/p/uriparser/bugs/24/
Index: uriparser-0.8.1/src/UriCommon.c
===================================================================
--- uriparser-0.8.1.orig/src/UriCommon.c
+++ uriparser-0.8.1/src/UriCommon.c
@@ -98,7 +98,15 @@ int URI_FUNC(CompareRange)(
return -1;
}
- return URI_STRNCMP(a->first, b->first, (a->afterLast - a->first));
+ diff = URI_STRNCMP(a->first, b->first, (a->afterLast - a->first));
+
+ if (diff > 0) {
+ return 1;
+ } else if (diff < 0) {
+ return -1;
+ }
+
+ return diff;
}