aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-02-28 21:30:51 +0100
committerMax Kellermann <max@duempel.org>2015-02-28 23:00:26 +0100
commitf4f21f462d2498dc48b2de66b4d64d5334916d93 (patch)
treeb4e53cd46a9b9a5ce632709b92bc9a6afb460edc
parentd09b8b5bd74919f0d1d70399ad0d3da3544bc588 (diff)
downloadmpd-f4f21f462d2498dc48b2de66b4d64d5334916d93.tar.gz
mpd-f4f21f462d2498dc48b2de66b4d64d5334916d93.tar.xz
mpd-f4f21f462d2498dc48b2de66b4d64d5334916d93.zip
fs/CheckFile: convert path to UTF-8 for error message
-rw-r--r--src/fs/CheckFile.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/fs/CheckFile.cxx b/src/fs/CheckFile.cxx
index 0068db639..e900fe9af 100644
--- a/src/fs/CheckFile.cxx
+++ b/src/fs/CheckFile.cxx
@@ -41,23 +41,28 @@ CheckDirectoryReadable(Path path_fs)
}
if (!fi.IsDirectory()) {
+ const auto path_utf8 = path_fs.ToUTF8();
FormatError(config_domain,
- "Not a directory: %s", path_fs.c_str());
+ "Not a directory: %s", path_utf8.c_str());
return;
}
#ifndef WIN32
const auto x = AllocatedPath::Build(path_fs,
PathTraitsFS::CURRENT_DIRECTORY);
- if (!GetFileInfo(x, fi) && errno == EACCES)
+ if (!GetFileInfo(x, fi) && errno == EACCES) {
+ const auto path_utf8 = path_fs.ToUTF8();
FormatError(config_domain,
"No permission to traverse (\"execute\") directory: %s",
- path_fs.c_str());
+ path_utf8.c_str());
+ }
#endif
const DirectoryReader reader(path_fs);
- if (reader.HasFailed() && errno == EACCES)
+ if (reader.HasFailed() && errno == EACCES) {
+ const auto path_utf8 = path_fs.ToUTF8();
FormatError(config_domain,
- "No permission to read directory: %s", path_fs.c_str());
-
+ "No permission to read directory: %s",
+ path_utf8.c_str());
+ }
}