aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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());
+ }
}