diff --git a/src/archive/ArchiveLookup.cxx b/src/archive/ArchiveLookup.cxx index 24643b644..f11247fa8 100644 --- a/src/archive/ArchiveLookup.cxx +++ b/src/archive/ArchiveLookup.cxx @@ -53,7 +53,7 @@ archive_lookup(PathTraitsFS::pointer_type pathname) //its a file ? if (file_info.IsRegular()) { //so the upper should be file - return {Path::FromFS(pathname), Path::FromFS(slash + 1)}; + return {AllocatedPath::FromFS(pathname), AllocatedPath::FromFS(slash + 1)}; } else { return {}; } diff --git a/src/archive/ArchiveLookup.hxx b/src/archive/ArchiveLookup.hxx index 119c28faa..b49845c0c 100644 --- a/src/archive/ArchiveLookup.hxx +++ b/src/archive/ArchiveLookup.hxx @@ -20,13 +20,13 @@ #ifndef MPD_ARCHIVE_LOOKUP_HXX #define MPD_ARCHIVE_LOOKUP_HXX -#include "fs/Path.hxx" +#include "fs/AllocatedPath.hxx" struct ArchiveLookupResult { - Path archive = nullptr; - Path inside = nullptr; + AllocatedPath archive = nullptr; + AllocatedPath inside = nullptr; - constexpr operator bool() const noexcept { + operator bool() const noexcept { return !archive.IsNull(); } }; diff --git a/test/test_archive.cxx b/test/test_archive.cxx index ae3b9c3b1..6ae6a3450 100644 --- a/test/test_archive.cxx +++ b/test/test_archive.cxx @@ -29,7 +29,6 @@ TEST(ArchiveTest, Lookup) path = strdup("dummy/foo/bar"); auto result = archive_lookup(path); EXPECT_TRUE(result); - EXPECT_EQ((const char *)path, result.archive.c_str()); EXPECT_STREQ(result.archive.c_str(), "dummy"); EXPECT_STREQ(result.inside.c_str(), "foo/bar"); free(path); @@ -37,7 +36,6 @@ TEST(ArchiveTest, Lookup) path = strdup("config.h/foo/bar"); result = archive_lookup(path); EXPECT_TRUE(result); - EXPECT_EQ((const char *)path, result.archive.c_str()); EXPECT_STREQ(result.archive.c_str(), "config.h"); EXPECT_STREQ(result.inside.c_str(), "foo/bar"); free(path);