summaryrefslogtreecommitdiff
path: root/src/UriShorten.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhsoting.net>2018-09-08 10:21:01 +0200
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2018-09-08 10:21:01 +0200
commit273a72f7b6ffa258ef3735ef44d3adf254b04c3f (patch)
tree642b60314bb654c66dd926dd10f112cae4f257f4 /src/UriShorten.c
parente94f3be22cd927eb2b5d9554eae2032a971c7e7e (diff)
parent21ce7e27a89c3f9c2fb4bc8bd59877dc2d8cd6b9 (diff)
Update upstream source from tag 'upstream/0.8.6'
Update to upstream version '0.8.6' with Debian dir dab399747c753aac5012df1b62df1aee932286fc
Diffstat (limited to 'src/UriShorten.c')
-rw-r--r--src/UriShorten.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/UriShorten.c b/src/UriShorten.c
index 0145f68..e7f6df4 100644
--- a/src/UriShorten.c
+++ b/src/UriShorten.c
@@ -111,22 +111,12 @@ static URI_INLINE UriBool URI_FUNC(EqualsAuthority)(const URI_TYPE(Uri) * first,
/* IPvFuture */
if (first->hostData.ipFuture.first != NULL) {
return ((second->hostData.ipFuture.first != NULL)
- && !URI_STRNCMP(first->hostData.ipFuture.first,
- second->hostData.ipFuture.first,
- first->hostData.ipFuture.afterLast
- - first->hostData.ipFuture.first))
- ? URI_TRUE : URI_FALSE;
+ && !URI_FUNC(CompareRange)(&first->hostData.ipFuture,
+ &second->hostData.ipFuture)) ? URI_TRUE : URI_FALSE;
}
- if (first->hostText.first != NULL) {
- return ((second->hostText.first != NULL)
- && !URI_STRNCMP(first->hostText.first,
- second->hostText.first,
- first->hostText.afterLast
- - first->hostText.first)) ? URI_TRUE : URI_FALSE;
- }
-
- return (second->hostText.first == NULL);
+ return !URI_FUNC(CompareRange)(&first->hostText, &second->hostText)
+ ? URI_TRUE : URI_FALSE;
}
@@ -155,8 +145,7 @@ static int URI_FUNC(RemoveBaseUriImpl)(URI_TYPE(Uri) * dest,
}
/* [01/50] if (A.scheme != Base.scheme) then */
- if (URI_STRNCMP(absSource->scheme.first, absBase->scheme.first,
- absSource->scheme.afterLast - absSource->scheme.first)) {
+ if (URI_FUNC(CompareRange)(&absSource->scheme, &absBase->scheme)) {
/* [02/50] T.scheme = A.scheme; */
dest->scheme = absSource->scheme;
/* [03/50] T.authority = A.authority; */
@@ -216,8 +205,7 @@ static int URI_FUNC(RemoveBaseUriImpl)(URI_TYPE(Uri) * dest,
dest->absolutePath = URI_FALSE;
/* [22/50] while (first(A.path) == first(Base.path)) do */
while ((sourceSeg != NULL) && (baseSeg != NULL)
- && !URI_STRNCMP(sourceSeg->text.first, baseSeg->text.first,
- sourceSeg->text.afterLast - sourceSeg->text.first)
+ && !URI_FUNC(CompareRange)(&sourceSeg->text, &baseSeg->text)
&& !((sourceSeg->text.first == sourceSeg->text.afterLast)
&& ((sourceSeg->next == NULL) != (baseSeg->next == NULL)))) {
/* [23/50] A.path++; */