summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rlog.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2006-04-14 23:29:02 +0000
committerJoris Vink <joris@cvs.openbsd.org>2006-04-14 23:29:02 +0000
commit8af96e7c660d4c7fe0a43c8a7b9cfbdd5eeb1517 (patch)
treefd957d074a13b5cb04fa41b240ed6468393f3349 /usr.bin/rcs/rlog.c
parent2ef14b987111198bdbff225245defe33b8d0b5d9 (diff)
- don't append the extension if it's already there (PR 5076).
- show magic branches in rlog (thanks for that nicer hack niall). - correct output in rcsdiff, so we perfectly match gnu's all these bugs were found by sturm@ while he was using cvsweb (which uses the RCS tools). "it is in my view that you should put it in" niallo@
Diffstat (limited to 'usr.bin/rcs/rlog.c')
-rw-r--r--usr.bin/rcs/rlog.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c
index b25707dab3d..b4b0ec17091 100644
--- a/usr.bin/rcs/rlog.c
+++ b/usr.bin/rcs/rlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlog.c,v 1.44 2006/04/14 15:15:20 ray Exp $ */
+/* $OpenBSD: rlog.c,v 1.45 2006/04/14 23:29:01 joris Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -62,6 +62,7 @@ rlog_main(int argc, char **argv)
int i, ch;
char fpath[MAXPATHLEN];
+ rcsnum_flags |= RCSNUM_NO_MAGIC;
hflag = Rflag = rflag = 0;
while ((ch = rcs_getopt(argc, argv, RLOG_OPTSTRING)) != -1) {
switch (ch) {
@@ -169,14 +170,24 @@ rlog_file(const char *fname, RCSFILE *file)
struct rcs_access *acp;
struct rcs_delta *rdp;
struct rcs_lock *lkp;
+ char *workfile, *p;
if (rflag == 1)
nrev = rlog_rev_select(file);
else
nrev = file->rf_ndelta;
+ if ((workfile = basename(fname)) == NULL)
+ fatal("failed to get basename of '%s'", fname);
+
+ /*
+ * In case they specified 'foo,v' as argument.
+ */
+ if ((p = strrchr(workfile, ',')) != NULL)
+ *p = '\0';
+
printf("\nRCS file: %s", file->rf_path);
- printf("\nWorking file: %s", fname);
+ printf("\nWorking file: %s", workfile);
printf("\nhead:");
if (file->rf_head != NULL)
printf(" %s", rcsnum_tostr(file->rf_head, numb, sizeof(numb)));