aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/dir.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-01-03 15:42:56 +0000
committerChristopher Faylor <me@cgf.cx>2006-01-03 15:42:56 +0000
commit825d0b93850125861ebefa6925ada44fe8f93f92 (patch)
tree12dfa683094cb2f3ad072a93d2e0bbea4534d57f /winsup/cygwin/dir.cc
parent5d09b46dc35a314a61ba51334fa3ca425e866b29 (diff)
downloadnewlib-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.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r--winsup/cygwin/dir.cc11
1 files changed, 9 insertions, 2 deletions
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] == '.')
{