diff options
author | Max Kellermann <max@duempel.org> | 2015-10-19 10:56:13 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-10-19 10:56:13 +0200 |
commit | 38e86af75c02cf75e8dc372ef71cc8c3010d0313 (patch) | |
tree | 5057a932f8c11e990f26c4768b638bb28abd00fd /src/fs/Traits.cxx | |
parent | 607c2c5ba2c19f29c94690c5cc1e28c894286f70 (diff) | |
download | mpd-38e86af75c02cf75e8dc372ef71cc8c3010d0313.tar.gz mpd-38e86af75c02cf75e8dc372ef71cc8c3010d0313.tar.xz mpd-38e86af75c02cf75e8dc372ef71cc8c3010d0313.zip |
fs/Traits: use StringAfterPrefix() in Relative()
Diffstat (limited to 'src/fs/Traits.cxx')
-rw-r--r-- | src/fs/Traits.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fs/Traits.cxx b/src/fs/Traits.cxx index e434a779c..7eba0916a 100644 --- a/src/fs/Traits.cxx +++ b/src/fs/Traits.cxx @@ -19,6 +19,7 @@ #include "config.h" #include "Traits.hxx" +#include "util/StringUtil.hxx" #include <string.h> @@ -92,12 +93,11 @@ RelativePathImpl(typename Traits::const_pointer base, assert(base != nullptr); assert(other != nullptr); - const auto base_length = Traits::GetLength(base); - if (memcmp(base, other, base_length * sizeof(*base)) != 0) + other = StringAfterPrefix(other, base); + if (other == nullptr) /* mismatch */ return nullptr; - other += base_length; if (*other != 0) { if (!Traits::IsSeparator(*other)) /* mismatch */ |