summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cvs/util.c')
-rw-r--r--usr.bin/cvs/util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c
index 12a55fcbf1c..7d4472ea838 100644
--- a/usr.bin/cvs/util.c
+++ b/usr.bin/cvs/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.115 2007/09/04 19:07:04 tobias Exp $ */
+/* $OpenBSD: util.c,v 1.116 2007/09/09 20:24:06 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org>
@@ -38,6 +38,8 @@
#include "cvs.h"
#include "remote.h"
+extern int print_stdout;
+
/* letter -> mode type map */
static const int cvs_modetypes[26] = {
-1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1,
@@ -502,6 +504,14 @@ cvs_get_repository_name(const char *dir, char *dst, size_t len)
FILE *fp;
char *s, fpath[MAXPATHLEN];
+ /* During checkout -p, do not use any locally available files. */
+ if (cvs_cmdop == CVS_OP_CHECKOUT && print_stdout) {
+ dst[0] = '\0';
+ if (strlcat(dst, dir, len) >= len)
+ fatal("cvs_get_repository_name: truncation");
+ return;
+ }
+
(void)xsnprintf(fpath, sizeof(fpath), "%s/%s",
dir, CVS_PATH_REPOSITORY);