aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateWalk.cxx
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-01-24 02:26:38 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-01-28 00:13:45 +0600
commit3c7cf94643bc45237d1e61c4e6015d498e4400b0 (patch)
treebe93d9088f7b8199b0d07cce56017e6726a47f76 /src/UpdateWalk.cxx
parent3bd35d188320f20a98a1004c001b132fc0975437 (diff)
downloadmpd-3c7cf94643bc45237d1e61c4e6015d498e4400b0.tar.gz
mpd-3c7cf94643bc45237d1e61c4e6015d498e4400b0.tar.xz
mpd-3c7cf94643bc45237d1e61c4e6015d498e4400b0.zip
Path: convert fs_charset_to_utf8() to static method Path::ToUTF8()
Diffstat (limited to 'src/UpdateWalk.cxx')
-rw-r--r--src/UpdateWalk.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx
index dcac0f97e..3e0dfe48d 100644
--- a/src/UpdateWalk.cxx
+++ b/src/UpdateWalk.cxx
@@ -373,28 +373,25 @@ update_directory(Directory *directory, const struct stat *st)
struct dirent *ent;
while ((ent = readdir(dir))) {
- char *utf8;
+ std::string utf8;
struct stat st2;
if (skip_path(ent->d_name) || exclude_list.Check(ent->d_name))
continue;
- utf8 = fs_charset_to_utf8(ent->d_name);
- if (utf8 == NULL)
+ utf8 = Path::ToUTF8(ent->d_name);
+ if (utf8.empty())
continue;
- if (skip_symlink(directory, utf8)) {
- modified |= delete_name_in(directory, utf8);
- g_free(utf8);
+ if (skip_symlink(directory, utf8.c_str())) {
+ modified |= delete_name_in(directory, utf8.c_str());
continue;
}
- if (stat_directory_child(directory, utf8, &st2) == 0)
- update_directory_child(directory, utf8, &st2);
+ if (stat_directory_child(directory, utf8.c_str(), &st2) == 0)
+ update_directory_child(directory, utf8.c_str(), &st2);
else
- modified |= delete_name_in(directory, utf8);
-
- g_free(utf8);
+ modified |= delete_name_in(directory, utf8.c_str());
}
closedir(dir);