summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-11-11 10:06:53 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-11-11 10:06:53 +0000
commite9ea2dfdbba510e77c186ea236508c0aef0be4e2 (patch)
treeb4ba79c4cea23bea06c583e482cea45e0ffc3989 /usr.bin
parenta90103bd2a81497075686647954e267e30ce4282 (diff)
CVS/Entries needs at least one line specifying a 'D'irectory. If the
current directory has subdirectories, there is no need to apply another 'D' line. Sticks at GNU cvs behaviour.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/entries.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c
index a15f1908e37..25b1fd75d75 100644
--- a/usr.bin/cvs/entries.c
+++ b/usr.bin/cvs/entries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: entries.c,v 1.84 2007/10/05 19:28:23 gilles Exp $ */
+/* $OpenBSD: entries.c,v 1.85 2007/11/11 10:06:52 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -208,6 +208,9 @@ cvs_ent_close(CVSENTRIES *ep, int writefile)
{
FILE *fp;
struct cvs_ent_line *l;
+ int dflag;
+
+ dflag = 1;
if (writefile) {
if ((fp = fopen(ep->cef_bpath, "w")) == NULL)
@@ -217,6 +220,9 @@ cvs_ent_close(CVSENTRIES *ep, int writefile)
while ((l = TAILQ_FIRST(&(ep->cef_ent))) != NULL) {
if (writefile) {
+ if (l->buf[0] == 'D')
+ dflag = 0;
+
fputs(l->buf, fp);
fputc('\n', fp);
}
@@ -227,8 +233,10 @@ cvs_ent_close(CVSENTRIES *ep, int writefile)
}
if (writefile) {
- fputc('D', fp);
- fputc('\n', fp);
+ if (dflag) {
+ fputc('D', fp);
+ fputc('\n', fp);
+ }
(void)fclose(fp);
if (rename(ep->cef_bpath, ep->cef_path) == -1)