From 2ebe15dc9e474b432ed87be5440a9d682ec74363 Mon Sep 17 00:00:00 2001 From: Niall O'Higgins Date: Sat, 15 Oct 2005 22:56:04 +0000 Subject: - add username parameter to rcs_rev_add(), needed to implement at least `ci -wusername'. ok joris@ --- usr.bin/cvs/rcs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs/rcs.c') diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 9211b99d471..e214d9cb5f8 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.89 2005/10/11 00:10:16 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.90 2005/10/15 22:56:03 niallo Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -1433,10 +1433,13 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) * one). The argument specifies the log message for that revision, and * specifies the revision's date (a value of -1 is * equivalent to using the current time). + * If is NULL, set the author for this revision to the current user. + * Otherwise, set it to . * Returns 0 on success, or -1 on failure. */ int -rcs_rev_add(RCSFILE *rf, RCSNUM *rev, const char *msg, time_t date) +rcs_rev_add(RCSFILE *rf, RCSNUM *rev, const char *msg, time_t date, + const char *username) { time_t now; struct passwd *pw; @@ -1490,7 +1493,10 @@ rcs_rev_add(RCSFILE *rf, RCSNUM *rev, const char *msg, time_t date) rcsnum_cpy(old, rdp->rd_next, 0); rcsnum_free(old); - if ((rdp->rd_author = cvs_strdup(pw->pw_name)) == NULL) { + if (username == NULL) + username = pw->pw_name; + + if ((rdp->rd_author = cvs_strdup(username)) == NULL) { rcs_freedelta(rdp); return (-1); } -- cgit v1.2.3