summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-04-25 03:25:43 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-04-25 03:25:43 +0000
commitff5e81fe32caab5ab27fc633a8ea69e83af1c4a9 (patch)
treebcd0d5d8ca275e49406cbfa423f8db23d2784a03 /usr.bin
parent2cba027f6a14a0e7504589129e6500770da7b202 (diff)
The -r flag without an argument signifies HEAD for rcsmerge as well.
OK joris@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/rcsmerge.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/rcs/rcsmerge.c b/usr.bin/rcs/rcsmerge.c
index 3f5d14f00e6..0819ca30849 100644
--- a/usr.bin/rcs/rcsmerge.c
+++ b/usr.bin/rcs/rcsmerge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsmerge.c,v 1.33 2006/04/24 13:32:10 jmc Exp $ */
+/* $OpenBSD: rcsmerge.c,v 1.34 2006/04/25 03:25:42 ray Exp $ */
/*
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -43,7 +43,7 @@ rcsmerge_main(int argc, char **argv)
rev1 = rev2 = NULL;
rev_str1 = rev_str2 = NULL;
- while ((ch = rcs_getopt(argc, argv, "AEek:p::q::r:TVx::z:")) != -1) {
+ while ((ch = rcs_getopt(argc, argv, "AEek:p::q::r::TVx::z:")) != -1) {
switch (ch) {
case 'A': case 'E': case 'e':
break;
@@ -64,7 +64,8 @@ rcsmerge_main(int argc, char **argv)
flags |= QUIET;
break;
case 'r':
- rcs_setrevstr2(&rev_str1, &rev_str2, rcs_optarg);
+ rcs_setrevstr2(&rev_str1, &rev_str2,
+ rcs_optarg ? rcs_optarg : "");
break;
case 'T':
/*
@@ -122,9 +123,13 @@ rcsmerge_main(int argc, char **argv)
rev2 = NULL;
}
- if ((rev1 = rcs_getrevnum(rev_str1, file)) == NULL)
+ if (strcmp(rev_str1, "") == 0) {
+ rev1 = rcsnum_alloc();
+ rcsnum_cpy(file->rf_head, rev1, 0);
+ } else if ((rev1 = rcs_getrevnum(rev_str1, file)) == NULL)
fatal("invalid revision: %s", rev_str1);
- if (rev_str2 != NULL) {
+
+ if (rev_str2 != NULL && strcmp(rev_str2, "") != 0) {
if ((rev2 = rcs_getrevnum(rev_str2, file)) == NULL)
fatal("invalid revision: %s", rev_str2);
} else {