summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/cvs.h
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-09-15 22:12:24 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-09-15 22:12:24 +0000
commit412b8858d226637856e09d97b6535b7e85cb2a96 (patch)
tree77685173e0cea7917735ce4916b42474dfa430b4 /usr.bin/cvs/cvs.h
parent8638358dd1a684d2ee3499c8496bc5ecbb8314e4 (diff)
strip trailing slashes from any arguments passed to opencvs.
ok xsa@
Diffstat (limited to 'usr.bin/cvs/cvs.h')
-rw-r--r--usr.bin/cvs/cvs.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h
index de8e058ed78..76e5f761d59 100644
--- a/usr.bin/cvs/cvs.h
+++ b/usr.bin/cvs/cvs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.h,v 1.84 2005/09/15 17:01:10 xsa Exp $ */
+/* $OpenBSD: cvs.h,v 1.85 2005/09/15 22:12:23 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -250,7 +250,13 @@ struct cvsroot {
#define CVS_ENTF_SYNC 0x01 /* contents of disk and memory match */
#define CVS_ENTF_WR 0x02 /* file is opened for writing too */
-
+#define STRIP_SLASH(p) \
+ do { \
+ size_t _slen; \
+ _slen = strlen(p); \
+ while ((_slen > 0) && (p[_slen - 1] == '/')) \
+ p[--_slen] = '\0'; \
+ } while (0)
struct cvs_ent {
char *ce_buf;
u_int16_t ce_type;