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:00 +0200
committerJörg Frings-Fürst <debian@jff-webhsoting.net>2018-09-08 10:21:00 +0200
commit21ce7e27a89c3f9c2fb4bc8bd59877dc2d8cd6b9 (patch)
tree50fac950719fa0c9f3f2ed1fa99e90c7a079011c /src/UriShorten.c
parent6d05f3e01a26fa416c9d0150163db20abac4b4ef (diff)
New upstream version 0.8.6upstream/0.8.6
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++; */