summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-05-30 08:23:32 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-05-30 08:23:32 +0000
commit1980814e1d8c6a7944791e27fbac0d0aecedc509 (patch)
tree987da4b98c8e379eac21ab70df94e6db5b892133 /usr.bin
parent514fd1766659c19d356f05dc7410e77f62d2d4a1 (diff)
handle special files when doing `cvs add *'; input+OK joris@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/add.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c
index 99da0eeb348..63bbee32c86 100644
--- a/usr.bin/cvs/add.c
+++ b/usr.bin/cvs/add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: add.c,v 1.48 2006/05/30 07:09:38 xsa Exp $ */
+/* $OpenBSD: add.c,v 1.49 2006/05/30 08:23:31 xsa Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -84,6 +84,17 @@ cvs_add_local(struct cvs_file *cf)
cvs_file_classify(cf, 0);
+ /* dont use `cvs add *' */
+ if (strcmp(cf->file_name, ".") == 0 ||
+ strcmp(cf->file_name, "..") == 0 ||
+ strcmp(cf->file_name, CVS_PATH_CVSDIR) == 0) {
+ if (verbosity > 1)
+ cvs_log(LP_ERR,
+ "cannot add special file `%s'; skipping",
+ cf->file_name);
+ return;
+ }
+
if (cf->file_type == CVS_DIR)
add_directory(cf);
else