Does not understand . as current folder (Trac #4)

This commit is contained in:
Kimmo Varis 2009-01-17 19:34:11 +00:00
parent f6452e3613
commit bfc82f29eb
1 changed files with 11 additions and 3 deletions

View File

@ -157,11 +157,19 @@ void FileLister::RecursiveAddFiles(std::vector<std::string> &filenames, const st
{
std::ostringstream bdir, oss;
oss << path;
if (path.length() > 0 && path[path.length()-1] == '/')
if (path.length() > 0)
{
// Windows doesn't recognize "." as current folder by default
if (path == ".")
{
oss << "/*";
}
else if (path[path.length() - 1] == '/')
{
bdir << path;
oss << "*";
}
}
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(oss.str().c_str(), &ffd);