aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs/Path.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-07 18:58:37 +0100
committerMax Kellermann <max@duempel.org>2014-02-07 19:08:51 +0100
commitd744c997d8a4370d56901c5bdf92d3cca0ef83bc (patch)
tree808a88c401091b9c8444745e900152599badbd14 /src/fs/Path.cxx
parent6b421cc354cb0c297fcf99d7824b99b61caec99d (diff)
downloadmpd-d744c997d8a4370d56901c5bdf92d3cca0ef83bc.tar.gz
mpd-d744c997d8a4370d56901c5bdf92d3cca0ef83bc.tar.xz
mpd-d744c997d8a4370d56901c5bdf92d3cca0ef83bc.zip
fs/Traits: add function Relative()
Move code from Path::RelativeFS() and make it generic.
Diffstat (limited to 'src/fs/Path.cxx')
-rw-r--r--src/fs/Path.cxx22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx
index 54ad1c3a8..8288a4fec 100644
--- a/src/fs/Path.cxx
+++ b/src/fs/Path.cxx
@@ -26,25 +26,3 @@ Path::ToUTF8() const
{
return ::PathToUTF8(c_str());
}
-
-const char *
-Path::RelativeFS(const char *other_fs) const
-{
- const size_t l = length();
- if (memcmp(data(), other_fs, l) != 0)
- return nullptr;
-
- other_fs += l;
- if (*other_fs != 0) {
- if (!PathTraitsFS::IsSeparator(*other_fs))
- /* mismatch */
- return nullptr;
-
- /* skip remaining path separators */
- do {
- ++other_fs;
- } while (PathTraitsFS::IsSeparator(*other_fs));
- }
-
- return other_fs;
-}