summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2008-01-31 13:54:12 +0000
committertobias <tobias@openbsd.org>2008-01-31 13:54:12 +0000
commitc79f3bae87e05fe26e44b87abc855c17d2243b6e (patch)
treed441f3475e72d4c385f2e38cc87d3b2f9272991b /usr.bin/cvs
parentdo not leak confd on malloc failure in control_accept() (diff)
downloadwireguard-openbsd-c79f3bae87e05fe26e44b87abc855c17d2243b6e.tar.xz
wireguard-openbsd-c79f3bae87e05fe26e44b87abc855c17d2243b6e.zip
On repository-side, only parse files which end with ,v (RCS_FILE_EXT).
File name ",v" is ignored, too -- in opposite to weird GNU cvs that tries to create a file without name. OK joris@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/repository.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/cvs/repository.c b/usr.bin/cvs/repository.c
index ec9f698cc02..4ef127ee509 100644
--- a/usr.bin/cvs/repository.c
+++ b/usr.bin/cvs/repository.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: repository.c,v 1.16 2008/01/10 09:57:51 tobias Exp $ */
+/* $OpenBSD: repository.c,v 1.17 2008/01/31 13:54:12 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -150,9 +150,11 @@ cvs_repository_getdir(const char *dir, const char *wdir,
cvs_file_get(fpath, 0, dl);
break;
case CVS_FILE:
- if ((s = strrchr(fpath, ',')) != NULL)
+ if ((s = strrchr(fpath, ',')) != NULL &&
+ s != fpath && !strcmp(s, RCS_FILE_EXT)) {
*s = '\0';
- cvs_file_get(fpath, 0, fl);
+ cvs_file_get(fpath, 0, fl);
+ }
break;
default:
fatal("type %d unknown, shouldn't happen", type);