mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
Revert "Merge pull request #5181 from Morph1984/5174-review"
This reverts commitcdb36aef9e
, reversing changes made to5e9b77129f
.
This commit is contained in:
parent
cdb36aef9e
commit
ac3ec5ed13
1 changed files with 9 additions and 3 deletions
|
@ -136,10 +136,16 @@ bool CreateDirs(const fs::path& path) {
|
||||||
bool CreateFullPath(const fs::path& path) {
|
bool CreateFullPath(const fs::path& path) {
|
||||||
LOG_TRACE(Common_Filesystem, "path {}", path);
|
LOG_TRACE(Common_Filesystem, "path {}", path);
|
||||||
|
|
||||||
if (path.has_extension()) {
|
// Removes trailing slashes and turns any '\' into '/'
|
||||||
return CreateDirs(path.parent_path());
|
const auto new_path = SanitizePath(path.string(), DirectorySeparator::ForwardSlash);
|
||||||
|
|
||||||
|
if (new_path.rfind('.') == std::string::npos) {
|
||||||
|
// The path is a directory
|
||||||
|
return CreateDirs(new_path);
|
||||||
} else {
|
} else {
|
||||||
return CreateDirs(path);
|
// The path is a file
|
||||||
|
// Creates directory preceding the last '/'
|
||||||
|
return CreateDirs(new_path.substr(0, new_path.rfind('/')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue