From 64551ae0434176b19d4abf908eee08e75890dfb6 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 6 Dec 2019 12:27:23 -0500 Subject: Cummulative work --- compat.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 compat.c (limited to 'compat.c') diff --git a/compat.c b/compat.c new file mode 100644 index 0000000..082a602 --- /dev/null +++ b/compat.c @@ -0,0 +1,16 @@ +#include +#include "config.h" + +#ifndef HAVE_STRSEP +// credit: Dan Cross via https://unixpapa.com/incnote/string.html +char *strsep(char **sp, char *sep) +{ + char *p, *s; + if (sp == NULL || *sp == NULL || **sp == '\0') return(NULL); + s = *sp; + p = s + strcspn(s, sep); + if (*p != '\0') *p++ = '\0'; + *sp = p; + return(s); +} +#endif \ No newline at end of file -- cgit