* dir.cc (readdir): Avoid reading from the beginning when

readdir is called after a previous call has returned NULL.
This commit is contained in:
Corinna Vinschen
2000-11-09 13:32:33 +00:00
parent 3aae15c9ba
commit edd7573015
2 changed files with 7 additions and 1 deletions

View File

@@ -145,7 +145,8 @@ readdir (DIR * dir)
return res;
}
if (dir->__d_u.__d_data.__handle == INVALID_HANDLE_VALUE)
if (dir->__d_u.__d_data.__handle == INVALID_HANDLE_VALUE
&& dir->__d_position == 0)
{
handle = FindFirstFileA (dir->__d_dirname, &buf);
DWORD lasterr = GetLastError ();