From b192558c497964c2e48932e02171e1983dcbc49b Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 7 Jun 2005 13:16:56 +0000 Subject: [PATCH] use a form of directory iteration search Sebastian Martel reports will work with Win98 [SVN r29465] --- src/operations_posix_windows.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/operations_posix_windows.cpp b/src/operations_posix_windows.cpp index dc7818d..7f33c8f 100644 --- a/src/operations_posix_windows.cpp +++ b/src/operations_posix_windows.cpp @@ -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;