summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2001-01-21 08:24:41 +0000
committerwill <will@FreeBSD.org>2001-01-21 08:24:41 +0000
commit9e75a55e4ba3ce9b7eec70c9fa00d439225321c5 (patch)
tree3097cea8ddb0d8ead53f36053c2949d7d4c5bdb1 /usr.bin/make
parentdd1ea82faf371a2bb93353a5b494e8b04c429427 (diff)
downloadFreeBSD-src-9e75a55e4ba3ce9b7eec70c9fa00d439225321c5.zip
FreeBSD-src-9e75a55e4ba3ce9b7eec70c9fa00d439225321c5.tar.gz
Fix style(9) bug; use ISDOT[DOT,]() macro available in util.c by moving
it to make.h so both dir.c and util.c can use it, although bde didn't particularly like this part of the idea, IMO it's cleaner than it was. Submitted by: bde
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/dir.c15
-rw-r--r--usr.bin/make/make.h2
-rw-r--r--usr.bin/make/util.c3
3 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index f920731..0c16cc8 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1067,15 +1067,14 @@ Dir_AddDir (path, name)
}
#endif /* sun && d_ino */
- /* Skip the '.' and '..' entries by checking for them specifically
- * instead of assuming readdir() reuturns them in that order when
- * first going through a directory. This is needed for XFS over
- * NFS filesystems since SGI does not guarantee that these are the
- * first two entries returned from readdir().
+ /* Skip the '.' and '..' entries by checking for them
+ * specifically instead of assuming readdir() reuturns them in
+ * that order when first going through a directory. This is
+ * needed for XFS over NFS filesystems since SGI does not
+ * guarantee that these are * the first two entries returned
+ * from readdir().
*/
- if (dp->d_name[0] == '.' &&
- (dp->d_name[1] == NULL ||
- (dp->d_name[1] == '.' && dp->d_name[2] == NULL)))
+ if (ISDOT(dp->d_name) || ISDOTDOT(dp->d_name))
continue;
(void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL);
diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h
index 003663b..81aabcb 100644
--- a/usr.bin/make/make.h
+++ b/usr.bin/make/make.h
@@ -365,6 +365,8 @@ extern int debug;
#endif /* __STDC__ */
#define DEBUG(module) (debug & CONCAT(DEBUG_,module))
+#define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/')))
+#define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1])))
/*
* Since there are so many, all functions that return non-integer values are
diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c
index 80197b9..67054c2 100644
--- a/usr.bin/make/util.c
+++ b/usr.bin/make/util.c
@@ -155,9 +155,6 @@ signal(s, a)) ()
#ifndef DEV_DEV_COMPARE
# define DEV_DEV_COMPARE(a, b) ((a) == (b))
#endif
-#define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/')))
-#define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1])))
-
/* strrcpy():
* Like strcpy, going backwards and returning the new pointer
OpenPOWER on IntegriCloud