diff options
author | Konstantin Sobolev <konstantin.sobolev@gmail.com> | 2008-11-20 18:22:07 +0100 |
---|---|---|
committer | Max Kellermann <mk@cm4all.com> | 2008-11-20 18:22:07 +0100 |
commit | 7ac3abf49958613504166efbd5fed93a40c176f9 (patch) | |
tree | 83bfb31637e2b1fb398eec3975f00bc1a36b203a /src/update.c | |
parent | 23b097593ee7b9ec30c15fd6f6c750850a7b5b5a (diff) | |
download | mpd-7ac3abf49958613504166efbd5fed93a40c176f9.tar.gz mpd-7ac3abf49958613504166efbd5fed93a40c176f9.tar.xz mpd-7ac3abf49958613504166efbd5fed93a40c176f9.zip |
update: pass UTF-8 path to skip_symlink()
skip_symlinks() expects an UTF-8 encoded file name, but
updateDirectory() passed ent->d_name (in file system encoding) to it.
Convert it to UTF-8 first.
Diffstat (limited to 'src/update.c')
-rw-r--r-- | src/update.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/update.c b/src/update.c index 38bc22a28..dac4f08f4 100644 --- a/src/update.c +++ b/src/update.c @@ -389,12 +389,11 @@ updateDirectory(struct directory *directory, const struct stat *st) char *utf8; struct stat st2; - if (skip_path(ent->d_name) || - skip_symlink(directory, ent->d_name)) + if (skip_path(ent->d_name)) continue; utf8 = fs_charset_to_utf8(path_max_tmp, ent->d_name); - if (!utf8) + if (utf8 == NULL || skip_symlink(directory, utf8)) continue; if (stat_directory_child(directory, utf8, &st2) == 0) |