diff options
author | 2007-10-09 12:25:27 +0000 | |
---|---|---|
committer | 2007-10-09 12:25:27 +0000 | |
commit | f1f4c0cfa1f7bedf1e5715c35eabe03b2a4bb6b6 (patch) | |
tree | 4ddb5df968d2441d3c149057eedefe2b6e5314c4 /usr.bin/cvs/annotate.c | |
parent | Do not use working HEAD (file_rcsrev), instead use file_rcs->rf_head to (diff) | |
download | wireguard-openbsd-f1f4c0cfa1f7bedf1e5715c35eabe03b2a4bb6b6.tar.xz wireguard-openbsd-f1f4c0cfa1f7bedf1e5715c35eabe03b2a4bb6b6.zip |
Properly parse supplied symbols with -r argument.
OK niallo@
Diffstat (limited to 'usr.bin/cvs/annotate.c')
-rw-r--r-- | usr.bin/cvs/annotate.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index 2def0a2636b..ff62d658de9 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.41 2007/10/09 12:24:13 tobias Exp $ */ +/* $OpenBSD: annotate.c,v 1.42 2007/10/09 12:25:27 tobias Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann <tobias@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -130,9 +130,17 @@ cvs_annotate_local(struct cvs_file *cf) if (cvs_specified_tag == NULL) rcs_rev_getlines(cf->file_rcs, cf->file_rcs->rf_head, &alines); else { - rev = rcsnum_parse(cvs_specified_tag); + if ((rev = rcs_translate_tag(cvs_specified_tag, + cf->file_rcs)) == NULL) { + if (!force_head) + /* Stick at weird GNU cvs, ignore error. */ + return; + rev = rcsnum_alloc(); + rcsnum_cpy(cf->file_rcs->rf_head, rev, 0); + } - if (rcsnum_cmp(rev, cf->file_rcs->rf_head, 0) < 0) { + /* rcs_translate_tag may give back an unavailable revision. */ + if (rcs_findrev(cf->file_rcs, rev) == NULL) { if (!force_head) { /* Stick at weird GNU cvs, ignore error. */ rcsnum_free(rev); |