diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-11-09 13:32:33 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-11-09 13:32:33 +0000 |
commit | edd7573015b4348ea982203096c8adb8fe1dbbee (patch) | |
tree | f80cd5267fc5f85a6096caa947a2b8cdbe122dd2 /winsup | |
parent | 3aae15c9ba650d18f92aad37d6a964484b2460f7 (diff) | |
download | newlib-edd7573015b4348ea982203096c8adb8fe1dbbee.zip newlib-edd7573015b4348ea982203096c8adb8fe1dbbee.tar.gz newlib-edd7573015b4348ea982203096c8adb8fe1dbbee.tar.bz2 |
* dir.cc (readdir): Avoid reading from the beginning when
readdir is called after a previous call has returned NULL.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/dir.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 90424c8..fbb2e4c 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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. diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index d73eeac..d2b8bfe 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -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 (); |