diff options
Diffstat (limited to 'usr.bin/cvs/util.c')
-rw-r--r-- | usr.bin/cvs/util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index adfd8854ba2..6130d9e3916 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.5 2004/07/30 16:52:13 jfb Exp $ */ +/* $OpenBSD: util.c,v 1.6 2004/08/05 13:50:12 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -259,6 +259,10 @@ cvs_splitpath(const char *path, char *dir, size_t dlen, char *file, size_t flen) const char *sp; struct stat st; + rlen = strlen(path); + while ((rlen > 0) && (path[rlen - 1] == '/')) + path[--rlen] = '\0'; + sp = strrchr(path, '/'); if (sp == NULL) { if (stat(path, &st) == -1) |