diff options
author | 2007-11-11 10:06:52 +0000 | |
---|---|---|
committer | 2007-11-11 10:06:52 +0000 | |
commit | d9d194c097fc861b94eb39e1277ec98266a243bc (patch) | |
tree | 80b379e07a28371c7069ec1ef94f553f801ad3c0 | |
parent | Added CVS keyword "Locker". Although it is a dummy function, it's already (diff) | |
download | wireguard-openbsd-d9d194c097fc861b94eb39e1277ec98266a243bc.tar.xz wireguard-openbsd-d9d194c097fc861b94eb39e1277ec98266a243bc.zip |
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.
-rw-r--r-- | usr.bin/cvs/entries.c | 14 |
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) |