summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-06 20:12:16 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-08-06 20:12:16 +0000
commitf55ce1bff9dd0fb3974f7c99880a878a6b38350d (patch)
tree0f66f52233977a2669868819b23932b84068560a /usr.bin
parent62b349c7ec3ae59c0b2c2d08d8630711a5f2acc7 (diff)
* add a flag CF_NOSYMS to avoid loading information about symbolic links
and fix 2 calls to cvs_splitpath() * unbreak cvs_file_find()
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/file.c9
-rw-r--r--usr.bin/cvs/file.h9
2 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index fd34d086a57..9234343ebb0 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.23 2004/08/06 14:55:56 jfb Exp $ */
+/* $OpenBSD: file.c,v 1.24 2004/08/06 20:12:15 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -321,7 +321,7 @@ cvs_file_find(CVSFILE *hier, const char *path)
do {
sp = strchr(pp, '/');
if (sp != NULL)
- *sp = '\0';
+ *(sp++) = '\0';
/* special case */
if (*pp == '.') {
@@ -349,7 +349,7 @@ cvs_file_find(CVSFILE *hier, const char *path)
pp = sp;
} while (sp != NULL);
- return (NULL);
+ return (cf);
}
@@ -457,6 +457,9 @@ cvs_file_getdir(CVSFILE *cf, int flags)
if ((flags & CF_IGNORE) && cvs_file_chkign(ent->d_name))
continue;
+ if ((flags & CF_NOSYMS) && (ent->d_type == DT_LNK))
+ continue;
+
snprintf(pbuf, sizeof(pbuf), "%s/%s",
cf->cf_path, ent->d_name);
cfp = cvs_file_lget(pbuf, flags, cf);
diff --git a/usr.bin/cvs/file.h b/usr.bin/cvs/file.h
index 13c787b82b3..99d29b6e9ca 100644
--- a/usr.bin/cvs/file.h
+++ b/usr.bin/cvs/file.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.h,v 1.7 2004/08/06 14:12:56 jfb Exp $ */
+/* $OpenBSD: file.h,v 1.8 2004/08/06 20:12:15 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -43,6 +43,7 @@ struct cvs_entries;
#define CF_KNOWN 0x10 /* only recurse in directories known to CVS */
#define CF_CREATE 0x20 /* create if file does not exist */
#define CF_MKADMIN 0x40 /* create administrative files if they're missing */
+#define CF_NOSYMS 0x80 /* ignore symbolic links */
/*
@@ -85,7 +86,13 @@ typedef struct cvs_file {
} CVSFILE;
+
+#define CVS_DIRF_STATIC 0x01
+#define CVS_DIRF_STICKY 0x02
+
+
struct cvs_dir {
+ u_int cd_flags;
struct cvsroot *cd_root;
char *cd_repo;
struct cvs_entries *cd_ent;