Decompile fn_18245 (RemoveDirectoryTree)
Batch #16662 by kyoshi: 0 byte-identical, 1 confirmed by peer review. - fn_18245 RemoveDirectoryTree: logic confirmed by peer review Peer-reviewed-by: eAthena, Yommy Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
599541c64d
commit
df29a0230c
1 changed files with 5 additions and 3 deletions
|
|
@ -8,6 +8,8 @@
|
|||
#include <sys/stat.h>
|
||||
#include <windows.h>
|
||||
|
||||
extern template std::string::basic_string(std::_String_constructor_concat_tag, const std::string&, const char*, std::size_t, const char*, std::size_t);
|
||||
|
||||
// OFFSET: 0x00AF45E0
|
||||
// FUNCTION: fn_18245
|
||||
void RemoveDirectoryTree(const char* path) {
|
||||
|
|
@ -37,11 +39,11 @@ void RemoveDirectoryTree(const char* path) {
|
|||
std::strcpy(filename, path);
|
||||
std::strcat(filename, "\\");
|
||||
for (const std::string& file : files) {
|
||||
_chmod((std::string(filename) + file).c_str(), _S_IWRITE);
|
||||
_unlink((std::string(filename) + file).c_str());
|
||||
_chmod((filename + file).c_str(), _S_IWRITE);
|
||||
_unlink((filename + file).c_str());
|
||||
}
|
||||
for (const std::string& directory : directories) {
|
||||
RemoveDirectoryTree((std::string(filename) + directory).c_str());
|
||||
RemoveDirectoryTree((filename + directory).c_str());
|
||||
}
|
||||
}
|
||||
_rmdir(path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue