Decompile fn_18255 (CreateDirectoryPath)
Batch #13555 by eAthena: 1 byte-identical, 0 confirmed by peer review. - fn_18255 CreateDirectoryPath: byte-identical Merged automatically: every function is byte-identical to the original.
This commit is contained in:
parent
087a98ab81
commit
35629cad8e
1 changed files with 4 additions and 4 deletions
|
|
@ -17,14 +17,14 @@ bool CreateDirectoryPath(std::string path) {
|
|||
return false;
|
||||
}
|
||||
|
||||
std::string::size_type separator = path.find('\\');
|
||||
std::string::size_type end = separator;
|
||||
std::string::size_type end = path.find("\\");
|
||||
std::string::size_type separator = end;
|
||||
std::string prefix;
|
||||
std::string remaining(path);
|
||||
while (prefix.size() != path.size()) {
|
||||
while (path.size() != prefix.size()) {
|
||||
prefix = path.substr(0, end);
|
||||
remaining = remaining.substr(separator + 1);
|
||||
separator = remaining.find('\\');
|
||||
separator = remaining.find("\\");
|
||||
end = separator == std::string::npos ? path.size() : end + separator + 1;
|
||||
if (_access(prefix.c_str(), 0) != 0 && _mkdir(prefix.c_str()) != 0) {
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue