summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-15 07:03:05 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-12-15 07:03:05 +0000
commit1d02f34ba0a0a546a399f160f1d8a6006ea5b407 (patch)
treec38ed8e99f7f49381ac06d4057ad573971a5e233 /usr.bin
parent141ce01649df5162549c9a7131db467fd519e51e (diff)
modify the CVS_DIR_ROOT() macro to grab the parent's root if the file
is a directory and has no root set
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/file.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/cvs/file.h b/usr.bin/cvs/file.h
index 6472df39a73..18c32b33086 100644
--- a/usr.bin/cvs/file.h
+++ b/usr.bin/cvs/file.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.h,v 1.12 2004/12/14 21:23:44 jfb Exp $ */
+/* $OpenBSD: file.h,v 1.13 2004/12/15 07:03:04 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -113,9 +113,9 @@ struct cvs_dir {
};
-#define CVS_DIR_ROOT(f) (((f)->cf_type == DT_DIR) ? \
- (f)->cf_ddat->cd_root : (((f)->cf_parent == NULL) ? \
- NULL : (f)->cf_parent->cf_ddat->cd_root))
+#define CVS_DIR_ROOT(f) ((((f)->cf_type == DT_DIR) && \
+ ((f)->cf_ddat->cd_root != NULL)) ? (f)->cf_ddat->cd_root : \
+ (((f)->cf_parent == NULL) ? NULL : (f)->cf_parent->cf_ddat->cd_root))
#define CVS_DIR_ENTRIES(f) (((f)->cf_type == DT_DIR) ? \
(f)->cf_ddat->cd_ent : (((f)->cf_parent == NULL) ? \