=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rcs/ci.c,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/usr.bin/rcs/ci.c 2005/10/10 14:21:37 1.16 --- src/usr.bin/rcs/ci.c 2005/10/10 14:49:32 1.17 *************** *** 1,4 **** ! /* $OpenBSD: ci.c,v 1.16 2005/10/10 14:21:37 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: ci.c,v 1.17 2005/10/10 14:49:32 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins * All rights reserved. *************** *** 143,148 **** --- 143,162 ---- 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 */ *************** *** 160,171 **** exit(1); 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, --- 174,179 ----