use a form of directory iteration search Sebastian Martel reports will work with Win98

[SVN r29465]
This commit is contained in:
Beman Dawes
2005-06-07 13:16:56 +00:00
parent 65a1ee085a
commit b192558c49

View File

@@ -165,7 +165,12 @@ namespace
// a ERROR_FILE_NOT_FOUND error which we do not considered an error. Instead,
// the handle is set to BOOST_INVALID_HANDLE_VALUE and a non-zero is returned.
{
std::string dirpath( std::string(dir) + "/*" );
// use a form of search Sebastian Martel reports will work with Win98
std::string dirpath( dir );
dirpath += (dirpath.empty()
|| (dirpath[dirpath.size()-1] != '\\'
&& dirpath[dirpath.size()-1] != '/')) ? "\\*" : "*";
return ( (handle = ::FindFirstFileA( dirpath.c_str(), &data ))
== BOOST_INVALID_HANDLE_VALUE
&& ::GetLastError() != ERROR_FILE_NOT_FOUND) ? 0 : data.cFileName;