Revert "Merge pull request from Morph1984/5174-review"

This reverts commit 1f3f6640f6, reversing
changes made to 38152bb0f7.
This commit is contained in:
Morph 2020-12-11 20:21:21 -05:00
parent 1f3f6640f6
commit 1992dbc3cf

View file

@ -136,10 +136,16 @@ bool CreateDirs(const fs::path& path) {
bool CreateFullPath(const fs::path& path) {
LOG_TRACE(Common_Filesystem, "path {}", path);
if (path.has_extension()) {
return CreateDirs(path.parent_path());
// Removes trailing slashes and turns any '\' into '/'
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 {
return CreateDirs(path);
// The path is a file
// Creates directory preceding the last '/'
return CreateDirs(new_path.substr(0, new_path.rfind('/')));
}
}