Fix readdir version 2

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix readdir version 2

Eric Blake (cygwin)
2006-01-03  Eric Blake  <[hidden email]>

        * dir.cc (readdir_worker): Update saw_dot* flags in version 2.

Index: cygwin/dir.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/dir.cc,v
retrieving revision 1.99
diff -u -r1.99 dir.cc
--- cygwin/dir.cc       19 Dec 2005 04:00:41 -0000      1.99
+++ cygwin/dir.cc       3 Jan 2006 15:29:32 -0000
@@ -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,6 +105,13 @@
       {
        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
       {




Reply | Threaded
Open this post in threaded view
|

Re: Fix readdir version 2

Christopher Faylor-2
On Tue, Jan 03, 2006 at 03:30:23PM +0000, Eric Blake wrote:
>2006-01-03  Eric Blake  <[hidden email]>
>
> * dir.cc (readdir_worker): Update saw_dot* flags in version 2.

I've applied this but it didn't apply cleanly.  You apparently somehow
munged the indentation, AFAICT.  Also, I added a new ChangeLog entry
since I didn't know what "version 2" referred to.

Thanks for the patch.

cgf