summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2007-06-28 04:48:53 +0000
committerJoris Vink <joris@cvs.openbsd.org>2007-06-28 04:48:53 +0000
commita856d4a1ee7f373d7a99e02307a021c60cf7e8b6 (patch)
tree9a8ba28959d344d9201bcfd1a25947373ddcc678 /usr.bin
parentff0c55b9dc5a31908ba3864e9f798340ef6fa70e (diff)
when logging to CVSROOT/history as a server fill in the
directory as <remote> instead of /tmp/cvs-serv<pid>
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/history.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c
index 04eaedb4d3c..75891f6413f 100644
--- a/usr.bin/cvs/history.c
+++ b/usr.bin/cvs/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.29 2007/06/20 16:25:46 xsa Exp $ */
+/* $OpenBSD: history.c,v 1.30 2007/06/28 04:48:52 joris Exp $ */
/*
* Copyright (c) 2007 Joris Vink <joris@openbsd.org>
*
@@ -77,8 +77,12 @@ cvs_history_add(int type, struct cvs_file *cf, const char *argument)
cvs_log(LP_TRACE, "cvs_history_add(`%c', `%s', `%s')",
historytab[type], (cf != NULL) ? cf->file_name : "", argument);
- if ((cwd = getcwd(NULL, MAXPATHLEN)) == NULL)
- fatal("cvs_history_add: getcwd: %s", strerror(errno));
+ if (cvs_server_active == 1) {
+ cwd = "<remote>";
+ } else {
+ if ((cwd = getcwd(NULL, MAXPATHLEN)) == NULL)
+ fatal("cvs_history_add: getcwd: %s", strerror(errno));
+ }
/* construct repository field */
if (cvs_cmdop != CVS_OP_CHECKOUT && cvs_cmdop != CVS_OP_EXPORT) {
@@ -126,7 +130,8 @@ cvs_history_add(int type, struct cvs_file *cf, const char *argument)
cvs_log(LP_ERR, "failed to add entry to history file");
}
- xfree(cwd);
+ if (cvs_server_active != 1)
+ xfree(cwd);
}
int