From ffd16b55a69a01b906805752acc11e26491138bc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 7 Feb 2014 19:01:06 +0100 Subject: StoragePlugin: add method MapToRelativeUTF8() Replaces map_to_relative_path() from Mapper.cxx. --- src/db/update/Walk.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/db') diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx index 0ea1eb450..8acabe7ea 100644 --- a/src/db/update/Walk.cxx +++ b/src/db/update/Walk.cxx @@ -29,13 +29,13 @@ #include "db/Uri.hxx" #include "storage/StorageInterface.hxx" #include "playlist/PlaylistRegistry.hxx" -#include "Mapper.hxx" #include "ExcludeList.hxx" #include "config/ConfigGlobal.hxx" #include "config/ConfigOption.hxx" #include "fs/AllocatedPath.hxx" #include "fs/Traits.hxx" #include "fs/FileSystem.hxx" +#include "fs/Charset.hxx" #include "storage/FileInfo.hxx" #include "util/Alloc.hxx" #include "util/UriUtil.hxx" @@ -274,8 +274,13 @@ UpdateWalk::SkipSymlink(const Directory *directory, if (PathTraitsFS::IsAbsolute(target_str)) { /* if the symlink points to an absolute path, see if that path is inside the music directory */ - const char *relative = map_to_relative_path(target_str); - return relative > target_str + const auto target_utf8 = PathToUTF8(target_str); + if (target_utf8.empty()) + return true; + + const char *relative = + storage.MapToRelativeUTF8(target_utf8.c_str()); + return relative != nullptr ? !follow_inside_symlinks : !follow_outside_symlinks; } -- cgit v1.2.3