diff --git a/src/filesys.cpp b/src/filesys.cpp index f961dedc6..be61ba430 100644 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -125,45 +125,32 @@ bool IsDirDelimiter(char c) bool RecursiveDelete(const std::string &path) { - infostream<<"Recursively deleting \""< content = GetDirListing(path); + for (const DirListNode &n: content) { + std::string fullpath = path + DIR_DELIM + n.name; + if (!RecursiveDelete(fullpath)) { + errorstream << "RecursiveDelete: Failed to recurse to " + << fullpath << std::endl; return false; } } - else - { - infostream<<"RecursiveDelete: Deleting content of directory " - < content = GetDirListing(path); - for(size_t i=0; i