diff options
author | Christopher Faylor <me@cgf.cx> | 2006-01-03 15:42:56 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-01-03 15:42:56 +0000 |
commit | 825d0b93850125861ebefa6925ada44fe8f93f92 (patch) | |
tree | 12dfa683094cb2f3ad072a93d2e0bbea4534d57f | |
parent | 5d09b46dc35a314a61ba51334fa3ca425e866b29 (diff) | |
download | newlib-825d0b93850125861ebefa6925ada44fe8f93f92.zip newlib-825d0b93850125861ebefa6925ada44fe8f93f92.tar.gz newlib-825d0b93850125861ebefa6925ada44fe8f93f92.tar.bz2 |
* dir.cc (readdir_worker): Ensure that saw_dot flags are updated when not
handling inodes.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/dir.cc | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 524ca35..58d60a2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2006-01-03 Eric Blake <ebb9@byu.net> + + * dir.cc (readdir_worker): Ensure that saw_dot flags are updated when + not handling inodes. + 2006-01-02 Christopher Faylor <cgf@timesys.com> * fhandler_console.cc (beep): New function. Restores missing "Default @@ -6,7 +11,7 @@ 2006-01-02 Christopher Faylor <cgf@timesys.com> - * dcrt0.cc (_dll_crt0): Move more leftover debugging stuff. + * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff. (cygwin_dll_init): Remove unneeded initializations. Call _dll_crt0 rather than dll_crt0_1. diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index 7682233..2e10908 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -1,6 +1,6 @@ /* dir.cc: Posix directory-related routines - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2006 Red Hat, Inc. This file is part of Cygwin. @@ -105,10 +105,17 @@ readdir_worker (DIR *dir, dirent *de) { de->__invalid_d_ino = 0; de->__ino32 = 0; + if (de->d_name[0] == '.') + { + if (de->d_name[1] == '\0') + dir->__flags |= dirent_saw_dot; + else if (de->d_name[1] == '.' && de->d_name[2] == '\0') + dir->__flags |= dirent_saw_dot_dot; + } } else { - /* Compute __invalid_d_ino by combining filename hash with the directory hash + /* Compute d_ino by combining filename hash with the directory hash (which was stored in dir->__d_dirhash when opendir was called). */ if (de->d_name[0] == '.') { |