=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/util.c,v retrieving revision 1.108 retrieving revision 1.109 diff -u -r1.108 -r1.109 --- src/usr.bin/cvs/util.c 2007/04/20 08:36:00 1.108 +++ src/usr.bin/cvs/util.c 2007/05/09 21:19:28 1.109 @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.108 2007/04/20 08:36:00 xsa Exp $ */ +/* $OpenBSD: util.c,v 1.109 2007/05/09 21:19:28 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * Copyright (c) 2005, 2006 Joris Vink @@ -210,45 +210,6 @@ } return (0); -} - -/* - * cvs_splitpath() - * - * Split a path into the base portion and the filename portion. - * The path is copied in and the last delimiter is replaced by a NUL - * byte. The pointer is set to point to the first character after - * that delimiter. - * Returns 0 on success, or -1 on failure. - */ -void -cvs_splitpath(const char *path, char *base, size_t blen, char **file) -{ - size_t rlen; - char *sp; - - if ((rlen = strlcpy(base, path, blen)) >= blen) - fatal("cvs_splitpath: path truncation"); - - while (rlen > 0 && base[rlen - 1] == '/') - base[--rlen] = '\0'; - - sp = strrchr(base, '/'); - if (sp == NULL) { - rlen = strlcpy(base, "./", blen); - if (rlen >= blen) - fatal("cvs_splitpath: path truncation"); - - rlen = strlcat(base, path, blen); - if (rlen >= blen) - fatal("cvs_splitpath: path truncation"); - - sp = base + 1; - } - - *sp = '\0'; - if (file != NULL) - *file = sp + 1; } /*