diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-15 22:56:04 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-15 22:56:04 +0000 |
commit | 2ebe15dc9e474b432ed87be5440a9d682ec74363 (patch) | |
tree | 3b1038294e331e841a5ab1e522cdea1e4c537043 /usr.bin/cvs/rcs.c | |
parent | 930e44e402c22e1d31fdc0173dd37b7adae2216d (diff) |
- add username parameter to rcs_rev_add(), needed to implement at least
`ci -wusername'.
ok joris@
Diffstat (limited to 'usr.bin/cvs/rcs.c')
-rw-r--r-- | usr.bin/cvs/rcs.c | 12 |
1 files changed, 9 insertions, 3 deletions
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 <jfb@openbsd.org> * All rights reserved. @@ -1433,10 +1433,13 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) * one). The <msg> argument specifies the log message for that revision, and * <date> specifies the revision's date (a value of -1 is * equivalent to using the current time). + * If <username> is NULL, set the author for this revision to the current user. + * Otherwise, set it to <username>. * 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); } |