summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-06-22 19:58:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-06-22 19:58:21 +0000
commite65448ab841a059a608bdc1e1925b7b3ec4d9491 (patch)
tree2ad5f5b22f7e7a55085bb124a0bf17ccffa2b1ac /usr.bin/make
parent259c049085f9638d60da0030cac7b7f46fb00675 (diff)
why should . and .. be the first two entries of any dir ?
Let code be portable. okay millert@
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/dir.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index f4c6c146400..cd11d4b7dab 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: dir.c,v 1.41 2004/04/07 13:11:35 espie Exp $ */
+/* $OpenBSD: dir.c,v 1.42 2004/06/22 19:58:20 espie Exp $ */
/* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */
/*
@@ -881,18 +881,12 @@ DirReaddiri(const char *name, const char *ename)
if ((d = opendir(p->name)) == NULL)
return NULL;
- /* Skip the first two entries -- these will *always* be . and .. */
- (void)readdir(d);
- (void)readdir(d);
while ((dp = readdir(d)) != NULL) {
-#if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */
- /* The sun directory library doesn't check for a 0 inode
- * (0-inode slots just take up space), so we have to do
- * it ourselves. */
- if (dp->d_fileno == 0)
- continue;
-#endif /* sun && d_ino */
+ if (dp->d_name[0] == '.' &&
+ (dp->d_name[1] == '\0' ||
+ (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
+ continue;
add_file(p, dp->d_name);
}
(void)closedir(d);