r15189: Add parentheses to force ISDOt and ISDOTDOT evaluation order. Fix typo
authorJames Peach <jpeach@samba.org>
Mon, 24 Apr 2006 02:36:55 +0000 (02:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:04:15 +0000 (14:04 -0500)
that made the BASE-DIR2 test fail.
(This used to be commit dcebc59a987b3c0d8379912d0451dedb9e895451)

source4/include/system/dir.h
source4/ntvfs/posix/pvfs_dirlist.c

index ce6aae02640b9b8e4fc6ea822bb88903c49baa32..14b36c0da0a16bde1fcfeb63dc0caa3dec2e960e 100644 (file)
  */
 #ifndef ISDOT
 #define ISDOT(path) ( \
-                       *((const char *)path) == '.' && \
-                       *(((const char *)path) + 1) == '\0' \
+                       *((const char *)(path)) == '.' && \
+                       *(((const char *)(path)) + 1) == '\0' \
                    )
 #endif
 
 #ifndef ISDOTDOT
 #define ISDOTDOT(path) ( \
-                           *((const char *)path) == '.' && \
-                           *(((const char *)path) + 1) == '.' && \
-                           *(((const char *)path) + 2) == '\0' \
+                           *((const char *)(path)) == '.' && \
+                           *(((const char *)(path)) + 1) == '.' && \
+                           *(((const char *)(path)) + 2) == '\0' \
                        )
 #endif
 
index a3eaca3cbbdd49929f6c19b5e541f26eb7a7ced2..517f5b68d0e8ee0f1466e5f4fa120dc91b936bfc 100644 (file)
@@ -218,7 +218,7 @@ const char *pvfs_list_next(struct pvfs_dir *dir, uint_t *ofs)
        while ((de = readdir(dir->dir))) {
                const char *dname = de->d_name;
 
-               if (ISDOT(dname) || ISDOT(dname)) {
+               if (ISDOT(dname) || ISDOTDOT(dname)) {
                        continue;
                }