mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 20:59:45 +01:00
fixed Windows DirectoryIterator bug with empty root dirs
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// DirectoryIterator_WIN32.cpp
|
// DirectoryIterator_WIN32.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/src/DirectoryIterator_WIN32.cpp#12 $
|
// $Id: //poco/Main/Foundation/src/DirectoryIterator_WIN32.cpp#13 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Filesystem
|
// Package: Filesystem
|
||||||
@@ -55,9 +55,12 @@ DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _fh(INVAL
|
|||||||
if (GetLastError() != ERROR_NO_MORE_FILES)
|
if (GetLastError() != ERROR_NO_MORE_FILES)
|
||||||
File::handleLastError(path);
|
File::handleLastError(path);
|
||||||
}
|
}
|
||||||
_current = _fd.cFileName;
|
else
|
||||||
if (_current == "." || _current == "..")
|
{
|
||||||
next();
|
_current = _fd.cFileName;
|
||||||
|
if (_current == "." || _current == "..")
|
||||||
|
next();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// DirectoryIterator_WIN32U.cpp
|
// DirectoryIterator_WIN32U.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/src/DirectoryIterator_WIN32U.cpp#6 $
|
// $Id: //poco/Main/Foundation/src/DirectoryIterator_WIN32U.cpp#7 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Filesystem
|
// Package: Filesystem
|
||||||
@@ -59,9 +59,12 @@ DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _fh(INVAL
|
|||||||
if (GetLastError() != ERROR_NO_MORE_FILES)
|
if (GetLastError() != ERROR_NO_MORE_FILES)
|
||||||
File::handleLastError(path);
|
File::handleLastError(path);
|
||||||
}
|
}
|
||||||
UnicodeConverter::toUTF8(_fd.cFileName, _current);
|
else
|
||||||
if (_current == "." || _current == "..")
|
{
|
||||||
next();
|
UnicodeConverter::toUTF8(_fd.cFileName, _current);
|
||||||
|
if (_current == "." || _current == "..")
|
||||||
|
next();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user