mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-30 07:52:08 +00:00
Added fix for when the filename syntax is invalid.
[SVN r23033]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user