fs/CheckFile: convert path to UTF-8 for error message
This commit is contained in:
parent
d09b8b5bd7
commit
f4f21f462d
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue