summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2009-03-24 18:33:26 +0000
committerJoris Vink <joris@cvs.openbsd.org>2009-03-24 18:33:26 +0000
commit3863c573376a7bc1c94fe46e2c08d676043e3ea3 (patch)
tree58a9bda3ce896884953a7d5cb6356d78bb6f9b41 /usr.bin
parent86608296c496767a15037111383d92766a74e410 (diff)
have CVS_OP_TAG and CVS_OP_RTAG use RCS_WRITE flag
when calling rcs_open(), so it gets automaticly synced at the end of operations for that file instead of explicitly calling rcs_write() when you're in RCS_READ mode only. while here, make sure we do not try to free an uninitialized list.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/file.c5
-rw-r--r--usr.bin/cvs/tag.c10
2 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index 49b30cff754..701aaff623d 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.254 2009/03/19 09:53:16 joris Exp $ */
+/* $OpenBSD: file.c,v 1.255 2009/03/24 18:33:25 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
@@ -695,13 +695,14 @@ cvs_file_classify(struct cvs_file *cf, const char *tag)
rflags = RCS_READ;
switch (cvs_cmdop) {
case CVS_OP_COMMIT:
+ case CVS_OP_TAG:
+ case CVS_OP_RTAG:
rflags = RCS_WRITE;
break;
case CVS_OP_ADMIN:
case CVS_OP_IMPORT:
case CVS_OP_LOG:
case CVS_OP_RLOG:
- case CVS_OP_RTAG:
rflags |= RCS_PARSE_FULLY;
break;
default:
diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c
index e15a09c0a0f..e78120deff0 100644
--- a/usr.bin/cvs/tag.c
+++ b/usr.bin/cvs/tag.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tag.c,v 1.78 2009/03/22 18:41:25 tobias Exp $ */
+/* $OpenBSD: tag.c,v 1.79 2009/03/24 18:33:25 joris Exp $ */
/*
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
*
@@ -226,7 +226,9 @@ cvs_tag(int argc, char **argv)
}
bad:
- cvs_trigger_freeinfo(&files_info);
+ if (line_list != NULL)
+ cvs_trigger_freeinfo(&files_info);
+
return (0);
}
@@ -350,8 +352,6 @@ cvs_tag_local(struct cvs_file *cf)
if (tag_del(cf) == 0) {
if (verbosity > 0)
cvs_printf("D %s\n", cf->file_path);
-
- rcs_write(cf->file_rcs);
}
return;
}
@@ -378,8 +378,6 @@ cvs_tag_local(struct cvs_file *cf)
if (tag_add(cf) == 0) {
if (verbosity > 0)
cvs_printf("T %s\n", cf->file_path);
-
- rcs_write(cf->file_rcs);
cvs_history_add(CVS_HISTORY_TAG, cf, tag_name);
}
break;