Added fix for when the filename syntax is invalid.

[SVN r23033]
This commit is contained in:
John Maddock
2004-06-05 11:52:22 +00:00
parent 8692b025bc
commit f69c19dc5c

View File

@@ -321,10 +321,12 @@ namespace boost
# else
if(::GetFileAttributesA( ph.string().c_str() ) == 0xFFFFFFFF)
{
if((::GetLastError() == ERROR_FILE_NOT_FOUND) || (::GetLastError() == ERROR_PATH_NOT_FOUND))
UINT err = ::GetLastError();
if((err == ERROR_FILE_NOT_FOUND) || (err == ERROR_PATH_NOT_FOUND) || (err == ERROR_INVALID_NAME))
return false; // GetFileAttributes failed because the path does not exist
// for any other error we assume the file does exist and fall through,
// this may not be the best policy though... (JM 20040330)
return true;
}
return true;
# endif