summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/rcs/rcsprog.c')
-rw-r--r--usr.bin/rcs/rcsprog.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 42cb17d6614..842d9bbe4a8 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.98 2006/04/12 22:54:23 ray Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.99 2006/04/13 00:58:25 ray Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -388,6 +388,25 @@ rcs_setrevstr2(char **str1, char **str2, char *new_str)
fatal("too many revision numbers");
}
+/*
+ * Get revision from file. The revision can be specified as a symbol or
+ * a revision number.
+ */
+RCSNUM *
+rcs_getrevnum(const char *rev_str, RCSFILE *file)
+{
+ RCSNUM *rev;
+
+ /* Search for symbol. */
+ rev = rcs_sym_getrev(file, rev_str);
+
+ /* Search for revision number. */
+ if (rev == NULL)
+ rev = rcsnum_parse(rev_str);
+
+ return (rev);
+}
+
int
main(int argc, char **argv)
{