# HG changeset patch # User vtchill@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1236913514 0 # Node ID 1d9154c535cf9e86c3914828c07f33cea804bce9 # Parent a9c4b895ed023fc7dc4f3338238d11081bd86589 fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now. diff -r a9c4b895ed02 -r 1d9154c535cf engine/core/vfs/vfsdirectory.cpp --- a/engine/core/vfs/vfsdirectory.cpp Fri Mar 13 02:47:03 2009 +0000 +++ b/engine/core/vfs/vfsdirectory.cpp Fri Mar 13 03:05:14 2009 +0000 @@ -66,7 +66,17 @@ } std::set VFSDirectory::listFiles(const std::string& path) const { + return list(path, false); + } + + std::set VFSDirectory::listDirectories(const std::string& path) const { + return list(path, true); + } + + std::set VFSDirectory::list(const std::string& path, bool directorys) const { + std::set list; std::string dir = m_root; + // Avoid double slashes if(path[0] == '/' && m_root[m_root.size()-1] == '/') { dir.append(path.substr(1)); @@ -75,25 +85,7 @@ dir.append(path); } - return list(dir, false); - } - - std::set VFSDirectory::listDirectories(const std::string& path) const { - std::string dir = m_root; - // Avoid double slashes - if(path[0] == '/' && m_root[m_root.size()-1] == '/') { - dir.append(path.substr(1)); - } - else { - dir.append(path); - } - - return list(dir, true); - } - - std::set VFSDirectory::list(const std::string& path, bool directorys) const { - std::set list; - bfs::path boost_path(m_root + path); + bfs::path boost_path(dir); if (!bfs::exists(boost_path) || !bfs::is_directory(boost_path)) return list;