From 188c53eb8b603b04e09d6a50cde302943b84ff34 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Fri, 1 Feb 2008 13:36:44 +0000 Subject: Another GNU cvs weirdo: During annotate, invalid revisions are allowed if -f is supplied (thus switching to HEAD), but unknown symbols end in fatal. --- regress/usr.bin/cvs/Makefile | 4 ++-- usr.bin/cvs/annotate.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/regress/usr.bin/cvs/Makefile b/regress/usr.bin/cvs/Makefile index fb350e7df59..422cfed5142 100644 --- a/regress/usr.bin/cvs/Makefile +++ b/regress/usr.bin/cvs/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2008/01/31 21:00:16 tobias Exp $ +# $OpenBSD: Makefile,v 1.15 2008/02/01 13:36:43 tobias Exp $ # Regression tests by Niall O'Higgins and # Tobias Stoeckmann . @@ -33,6 +33,7 @@ LTESTS= cvs-initial \ cvs-annotate \ cvs-annotate-rflag-inval_branch_rev \ cvs-annotate-rflag-inval_branch_rev-fflag \ + cvs-annotate-rflag-unknown_symbol-fflag \ cvs-checkout-rflag-1.1 \ cvs-update-Aflag \ cvs-status \ @@ -47,7 +48,6 @@ LTESTS= cvs-initial \ # cvs-checkout-dflag # cvs-update-for_subdir # Known to behave unconform to GNU cvs. -# cvs-annotate-rflag-unknown_symbol-fflag # cvs-diff-file .for t in ${LTESTS} diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index 9d47c272ae9..bc878f7ec18 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.45 2008/01/31 10:15:05 tobias Exp $ */ +/* $OpenBSD: annotate.c,v 1.46 2008/02/01 13:36:43 tobias Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann * Copyright (c) 2006 Xavier Santolaria @@ -137,6 +137,12 @@ cvs_annotate_local(struct cvs_file *cf) /* Stick at weird GNU cvs, ignore error. */ return; + /* -f is not allowed for unknown symbols */ + rev = rcsnum_parse(cvs_specified_tag); + if (rev == NULL) + fatal("no such tag %s", cvs_specified_tag); + + rcsnum_free(rev); rev = rcsnum_alloc(); rcsnum_cpy(cf->file_rcs->rf_head, rev, 0); } -- cgit v1.2.3