diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-11-25 14:16:45 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-11-25 14:16:45 +0000 |
commit | 78f975696bffc58366b55dd0b8d5bc9f9065a13a (patch) | |
tree | 72e5cda1ebee4a599a2a3029bcf611d0c690440c /usr.bin/rcs/rcsprog.c | |
parent | 6fd1543ce51a7e96037a6dc1e8f444869c7d22fa (diff) |
add `-T' support for rcsclean(1) and rcs(1);
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r-- | usr.bin/rcs/rcsprog.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c index df48069172b..dedc939d850 100644 --- a/usr.bin/rcs/rcsprog.c +++ b/usr.bin/rcs/rcsprog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.c,v 1.47 2005/11/25 13:50:01 xsa Exp $ */ +/* $OpenBSD: rcsprog.c,v 1.48 2005/11/25 14:16:44 xsa Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -376,6 +376,7 @@ rcs_main(int argc, char **argv) RCSFILE *file, *oldfile; RCSNUM *logrev; struct rcs_access *acp; + time_t rcs_mtime = -1; kflag = lkmode = -1; fmode = 0; @@ -465,10 +466,13 @@ rcs_main(int argc, char **argv) if (verbose == 1) printf("RCS file: %s\n", fpath); - file = rcs_open(fpath, flags, fmode); - if (file == NULL) + + if ((file = rcs_open(fpath, flags, fmode)) == NULL); continue; + if (flags & PRESERVETIME) + rcs_mtime = rcs_get_mtime(file->rf_path); + if (logstr != NULL) { if ((logmsg = strchr(logstr, ':')) == NULL) { cvs_log(LP_ERR, "missing log message"); @@ -478,7 +482,8 @@ rcs_main(int argc, char **argv) *logmsg++ = '\0'; if ((logrev = rcsnum_parse(logstr)) == NULL) { - cvs_log(LP_ERR, "'%s' bad revision number", logstr); + cvs_log(LP_ERR, + "'%s' bad revision number", logstr); rcs_close(file); continue; } @@ -532,6 +537,9 @@ rcs_main(int argc, char **argv) rcs_close(file); + if (flags & PRESERVETIME) + rcs_set_mtime(fpath, rcs_mtime); + if (verbose == 1) printf("done\n"); } |