summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-10-23 18:36:36 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-10-23 18:36:36 +0000
commit8c4512057ee2af140ece2980e1945791f393f847 (patch)
tree0a1dc7f7fc5cc564e19036a31c496a0e26dca95a
parente937cf4b41158cb1185c3d77a605b1b1ef574f49 (diff)
Use CVSROOT for "cvs import" - just ignore CVS/Root files. PR 6497 from
Michael W Bombardieri. ok tobias stsp
-rw-r--r--usr.bin/cvs/root.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/cvs/root.c b/usr.bin/cvs/root.c
index 2d1288235e9..d71b2f66be2 100644
--- a/usr.bin/cvs/root.c
+++ b/usr.bin/cvs/root.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: root.c,v 1.46 2009/02/21 12:52:47 joris Exp $ */
+/* $OpenBSD: root.c,v 1.47 2010/10/23 18:36:35 nicm Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -172,8 +172,11 @@ cvsroot_get(const char *dir)
if (cvs_server_active == 1)
return cvsroot_parse(dir);
- if (cvs_cmdop == CVS_OP_IMPORT)
- return NULL;
+ if (cvs_cmdop == CVS_OP_IMPORT) {
+ if ((rootstr = getenv("CVSROOT")) != NULL)
+ return (cvsroot_parse(rootstr));
+ return (NULL);
+ }
(void)xsnprintf(rootpath, MAXPATHLEN, "%s/%s", dir, CVS_PATH_ROOTSPEC);