summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-10-11 17:24:00 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-10-11 17:24:00 +0100
commit8ab9430bb4aaae32335514622f035de1febaa7ff (patch)
treecbb31350002474dff9fb31827448735276e3179f /utils
parent2e869ade2a1ed2d13f3d831d3d1f933006cacbdd (diff)
downloadnetsurf-8ab9430bb4aaae32335514622f035de1febaa7ff.tar.gz
netsurf-8ab9430bb4aaae32335514622f035de1febaa7ff.tar.bz2
Don't need url_compare any more.
Diffstat (limited to 'utils')
-rw-r--r--utils/url.c69
-rw-r--r--utils/url.h2
2 files changed, 0 insertions, 71 deletions
diff --git a/utils/url.c b/utils/url.c
index 84c62882a..e673d9254 100644
--- a/utils/url.c
+++ b/utils/url.c
@@ -720,75 +720,6 @@ url_func_result url_escape(const char *unescaped, size_t toskip,
}
/**
- * Compare two absolute, normalized URLs
- *
- * \param url1 URL 1
- * \param url2 URL 2
- * \param nofrag Ignore fragment part in comparison
- * \param result Pointer to location to store result (true if URLs match)
- * \return URL_FUNC_OK on success
- */
-url_func_result url_compare(const char *url1, const char *url2,
- bool nofrag, bool *result)
-{
- url_func_result status;
- struct url_components c1, c2;
- bool res = true;
-
- assert(url1 && url2 && result);
-
- /* Decompose URLs */
- status = url_get_components(url1, &c1);
- if (status != URL_FUNC_OK) {
- url_destroy_components(&c1);
- return status;
- }
-
- status = url_get_components(url2, &c2);
- if (status != URL_FUNC_OK) {
- url_destroy_components(&c2);
- url_destroy_components(&c1);
- return status;
- }
-
- if (((c1.scheme && c2.scheme) || (!c1.scheme && !c2.scheme )) &&
- ((c1.authority && c2.authority) ||
- (!c1.authority && !c2.authority)) &&
- ((c1.path && c2.path) || (!c1.path && !c2.path)) &&
- ((c1.query && c2.query) ||
- (!c1.query && !c2.query)) &&
- (nofrag || (c1.fragment && c2.fragment) ||
- (!c1.fragment && !c2.fragment))) {
-
- if (c1.scheme)
- res &= strcasecmp(c1.scheme, c2.scheme) == 0;
-
- /** \todo consider each part of the authority separately */
- if (c1.authority)
- res &= strcasecmp(c1.authority, c2.authority) == 0;
-
- if (c1.path)
- res &= strcmp(c1.path, c2.path) == 0;
-
- if (c1.query)
- res &= strcmp(c1.query, c2.query) == 0;
-
- if (!nofrag && c1.fragment)
- res &= strcmp(c1.fragment, c2.fragment) == 0;
- } else {
- /* Can't match */
- res = false;
- }
-
- *result = res;
-
- url_destroy_components(&c2);
- url_destroy_components(&c1);
-
- return URL_FUNC_OK;
-}
-
-/**
* Split a URL into separate components
*
* URLs passed to this function are assumed to be valid and no error checking
diff --git a/utils/url.h b/utils/url.h
index 95790335c..56de57662 100644
--- a/utils/url.h
+++ b/utils/url.h
@@ -58,8 +58,6 @@ url_func_result url_escape(const char *unescaped, size_t toskip,
url_func_result url_unescape(const char *str, char **result);
url_func_result url_canonical_root(const char *url, char **result);
url_func_result url_path(const char *url, char **result);
-url_func_result url_compare(const char *url1, const char *url2,
- bool nofrag, bool *result);
url_func_result url_get_components(const char *url,
struct url_components *result);