summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2005-10-10 14:49:33 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2005-10-10 14:49:33 +0000
commit6a1908424a714e762ceb2cde7a814d894bc80dd0 (patch)
tree0d979e45ab9a0caa7a3288cb02fd392dc6eafbf7 /usr.bin
parent7653931b6ce38edf10fe15a42244c1490e804249 (diff)
make sure that revision passed on command line is greater than HEAD.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/ci.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index 98384bfbf14..b00dd004e44 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.16 2005/10/10 14:21:37 niallo Exp $ */
+/* $OpenBSD: ci.c,v 1.17 2005/10/10 14:49:32 niallo Exp $ */
/*
* Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -143,6 +143,20 @@ checkin_main(int argc, char **argv)
cvs_log(LP_ERR, "failed to open rcsfile '%s'", fpath);
exit(1);
}
+ /*
+ * If rev is not specified on the command line,
+ * assume HEAD.
+ */
+ frev = file->rf_head;
+ /*
+ * If revision passed on command line is less than HEAD, bail.
+ */
+ if ((newrev != NULL) && (rcsnum_cmp(newrev, frev, 0) > 0)) {
+ cvs_log(LP_ERR, "revision is too low!");
+ status = 1;
+ rcs_close(file);
+ continue;
+ }
if (dflag) {
/* XXX */
@@ -162,12 +176,6 @@ checkin_main(int argc, char **argv)
filec = cvs_buf_release(bp);
/*
- * If rev is not specified on the command line,
- * assume HEAD.
- */
- frev = file->rf_head;
-
- /*
* Check for a lock belonging to this user. If none,
* abort check-in.
*/