aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util/UriUtil.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx
index 0782304e3..3f5ae3118 100644
--- a/src/util/UriUtil.cxx
+++ b/src/util/UriUtil.cxx
@@ -74,8 +74,6 @@ uri_get_suffix(const char *uri, UriSuffixBuffer &buffer)
static const char *
verify_uri_segment(const char *p)
{
- const char *q;
-
unsigned dots = 0;
while (*p == '.') {
++p;
@@ -85,7 +83,7 @@ verify_uri_segment(const char *p)
if (dots <= 2 && (*p == 0 || *p == '/'))
return nullptr;
- q = strchr(p + 1, '/');
+ const char *q = strchr(p + 1, '/');
return q != nullptr ? q : "";
}
@@ -109,8 +107,7 @@ uri_safe_local(const char *uri)
std::string
uri_remove_auth(const char *uri)
{
- const char *auth, *slash, *at;
-
+ const char *auth;
if (memcmp(uri, "http://", 7) == 0)
auth = uri + 7;
else if (memcmp(uri, "https://", 8) == 0)
@@ -121,11 +118,11 @@ uri_remove_auth(const char *uri)
/* unrecognized URI */
return std::string();
- slash = strchr(auth, '/');
+ const char *slash = strchr(auth, '/');
if (slash == nullptr)
slash = auth + strlen(auth);
- at = (const char *)memchr(auth, '@', slash - auth);
+ const char *at = (const char *)memchr(auth, '@', slash - auth);
if (at == nullptr)
/* no auth info present, do nothing */
return std::string();