* 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

@ -1,3 +1,8 @@
Thu Nov 9 14:30:00 2000 Corinna Vinschen <corinna@vinschen.de>
* dir.cc (readdir): Avoid reading from the beginning when
readdir is called after a previous call has returned NULL.
Wed Nov 8 21:00:31 2000 Christopher Faylor <cgf@cygnus.com>
* select.cc (peek_pipe): Deal with pending newline in pty_master.

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 ();