From d8df2f28b69eb4ba5fda87505743f700bf912ed4 Mon Sep 17 00:00:00 2001 From: Joel Heaton Date: Wed, 10 Jun 2015 21:49:10 +0100 Subject: [PATCH] fix deleting map/world data on Windows --- src/filesys.cpp | 47 +++++++++++++++++++++++++++-------------------- src/porting.cpp | 5 +++-- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/filesys.cpp b/src/filesys.cpp index 4322be9..5ee4b34 100644 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -148,27 +148,34 @@ bool RecursiveDelete(std::string path) { std::cerr<<"Removing \""< dir_list = GetDirListing(path); + for(int i = 0; i < dir_list.size(); i++) { + DirListNode &node = dir_list[i]; + std::string fpath = path + DIR_DELIM + node.name; + if(!RecursiveDelete(fpath)) { + std::cerr<<"Could not remove contents of \""<