Make uriCompareRangeA() return -1/0/1 like tests assume it does so package will build on aarch64

epel9
Peter Robinson 10 years ago
parent 78cd9bc0ca
commit 6acb59d674

@ -0,0 +1,34 @@
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;
}

@ -4,13 +4,14 @@
Name: uriparser
Version: 0.8.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: URI parsing library - RFC 3986
Group: System Environment/Libraries
License: BSD
URL: http://%{name}.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Patch0: uriparser-bug24.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: doxygen, graphviz, cpptest-devel
Requires: cpptest
@ -31,6 +32,7 @@ developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1
sed -i 's/\r//' THANKS
sed -i 's/\r//' COPYING
iconv -f iso-8859-1 -t utf-8 -o THANKS{.utf8,}
@ -89,6 +91,10 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/*.pc
%changelog
* Wed Jan 28 2015 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 0.8.1-3
- Make uriCompareRangeA() return -1/0/1 like tests assume it does
so package will build on aarch64.
* Fri Jan 09 2015 François Cami <fcami@fedoraproject.org> - 0.8.1-2
- Use PIC.

Loading…
Cancel
Save