diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-06 12:27:23 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-12-06 12:27:23 -0500 |
commit | 64551ae0434176b19d4abf908eee08e75890dfb6 (patch) | |
tree | 6e7c9d34a9575fe09fc0145aa848ce830cd9df04 /compat.c | |
parent | ae93deb9b1f4c83addd90e49af35543ce0c23a38 (diff) | |
download | spmc-64551ae0434176b19d4abf908eee08e75890dfb6.tar.gz |
Cummulative work
Diffstat (limited to 'compat.c')
-rw-r--r-- | compat.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 <string.h> +#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 |