mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-10 09:40:44 +00:00
Fixed Add-ons -> Remove Add-ons failing on windows.
This was caused by using remove() to delete directories which removes only files on windows. Used rmdir() for that purpose instead.
This commit is contained in:
parent
0230609cd3
commit
9ac0bc4004
@ -395,6 +395,14 @@ bool delete_directory(const std::string& path)
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
#ifdef _WIN32
|
||||
// remove() doesn't delete directories on windows.
|
||||
int (*remove)(const char*);
|
||||
if(is_directory(path))
|
||||
remove = rmdir;
|
||||
else
|
||||
remove = ::remove;
|
||||
#endif
|
||||
if(remove(path.c_str()) != 0) {
|
||||
LOG_FS << "remove(" << path << "): " << strerror(errno) << "\n";
|
||||
ret = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user