summaryrefslogtreecommitdiff
path: root/base/util_strsep.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2005-06-04 15:58:45 +0200
committerTor Andersson <tor@ghostscript.com>2005-06-04 15:58:45 +0200
commit7ee19483ed81a885f464d4e93f4eefb3d4037d30 (patch)
treee4d3faf561e694ae0cc7873381450db6a011ab5a /base/util_strsep.c
parentaf699a4657e103bd8fa72356eb3abebf221fe93a (diff)
downloadmupdf-7ee19483ed81a885f464d4e93f4eefb3d4037d30.tar.xz
new world order
Diffstat (limited to 'base/util_strsep.c')
-rw-r--r--base/util_strsep.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/util_strsep.c b/base/util_strsep.c
new file mode 100644
index 00000000..e54903ce
--- /dev/null
+++ b/base/util_strsep.c
@@ -0,0 +1,11 @@
+#include <string.h>
+
+char *strsep(char **stringp, const char *delim)
+{
+ char *ret = *stringp;
+ if (ret == NULL) return NULL;
+ if ((*stringp = strpbrk(*stringp, delim)) != NULL)
+ *((*stringp)++) = '\0';
+ return ret;
+}
+