update_walk: apply follow_inside_symlinks to absolute symlinks

This commit is contained in:
Max Kellermann
2011-07-20 07:05:10 +02:00
parent 2e28ed8f81
commit b2175629fd
2 changed files with 9 additions and 2 deletions

View File

@@ -714,8 +714,14 @@ skip_symlink(const struct directory *directory, const char *utf8_name)
return false;
}
if (buffer[0] == '/')
return !follow_outside_symlinks;
if (g_path_is_absolute(buffer)) {
/* if the symlink points to an absolute path, see if
that path is inside the music directory */
const char *relative = map_to_relative_path(buffer);
return relative > buffer
? !follow_inside_symlinks
: !follow_outside_symlinks;
}
p = buffer;
while (*p == '.') {