summaryrefslogtreecommitdiff
path: root/src/client/Client.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-11-18 18:02:28 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-11-18 18:02:28 (GMT)
commitaf29942117a828e244195a530d2aa40fa9b2a5e2 (patch)
tree18bf32a5d5893cdc73f29d737fa09e50d97a206a /src/client/Client.cpp
parent0be465aa4e658a75cad201b0f6f32b20acea9c9f (diff)
downloadpowder-af29942117a828e244195a530d2aa40fa9b2a5e2.zip
powder-af29942117a828e244195a530d2aa40fa9b2a5e2.tar.gz
Ensure directory enumeration works whether there's a path seperator at the end of the directory or not
Diffstat (limited to 'src/client/Client.cpp')
-rw-r--r--src/client/Client.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index 763814a..bde66d2 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -367,6 +367,9 @@ std::vector<std::string> Client::DirectorySearch(std::string directory, std::str
std::vector<std::string> Client::DirectorySearch(std::string directory, std::string search, std::vector<std::string> extensions)
{
//Get full file listing
+ //Normalise directory string, ensure / or \ is present
+ if(*directory.rbegin() != '/' && *directory.rbegin() != '\\')
+ directory += PATH_SEP;
std::vector<std::string> directoryList;
#if defined(WIN) && !defined(__GNUC__)
//Windows