From 58363cf4dde0c17301b4f4fd22032ba9ff781e21 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 7 Sep 2019 23:27:07 +0200 Subject: [PATCH] util/UriRelative: allow "parent" to end with slash --- src/util/UriRelative.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/UriRelative.cxx b/src/util/UriRelative.cxx index 36d2ba633..47faabcda 100644 --- a/src/util/UriRelative.cxx +++ b/src/util/UriRelative.cxx @@ -44,8 +44,8 @@ uri_is_child(const char *parent, const char *child) noexcept #endif const char *suffix = StringAfterPrefix(child, parent); - return suffix != nullptr && - *suffix == '/'; + return suffix != nullptr && *suffix != 0 && + (suffix == child || suffix[-1] == '/' || *suffix == '/'); }