X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/35f69d8ad928122528482418dcc77afb19819775..2b6b4d539b0aab98b1cbb9d8c639cb12473aae94:/lib/compat.c diff --git a/lib/compat.c b/lib/compat.c index 3e66cc91..c0cf63b4 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -58,3 +58,21 @@ void *memmove(void *dest, const void *src, size_t n) return dest; } #endif + +#ifndef HAVE_STRPBRK +/* Find the first ocurrence in S of any character in ACCEPT. + derived from glibc +*/ +char *strpbrk(const char *s, const char *accept) +{ + while (*s != '\0') { + const char *a = accept; + while (*a != '\0') { + if (*a++ == *s) return (char *)s; + } + ++s; + } + + return NULL; +} +#endif