aboutsummaryrefslogtreecommitdiff
path: root/libbb/platform.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 13:08:20 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 13:08:20 +1000
commit6a6efd31038d7afe977e3059508ae863e65cbdf5 (patch)
tree5cd69a751e893b83176751c80fcea7a7afeed1ae /libbb/platform.c
parenta6a2325ecf402054132daae169f71edb0fb849e3 (diff)
parent29082231d0cb1a5b327de5d515b16f332d4dbdaf (diff)
downloadbusybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.tar.gz
busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.tar.bz2
busybox-w32-6a6efd31038d7afe977e3059508ae863e65cbdf5.zip
Merge branch 'origin/master' (early part)
Diffstat (limited to 'libbb/platform.c')
-rw-r--r--libbb/platform.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libbb/platform.c b/libbb/platform.c
index 8642337d4..67048648f 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -120,3 +120,30 @@ char* FAST_FUNC strcasestr(const char *s, const char *pattern)
120 return 0; 120 return 0;
121} 121}
122#endif 122#endif
123
124#ifndef HAVE_STRSEP
125/* Copyright (C) 2004 Free Software Foundation, Inc. */
126char* FAST_FUNC strsep(char **stringp, const char *delim)
127{
128 char *start = *stringp;
129 char *ptr;
130
131 if (!start)
132 return NULL;
133
134 if (!*delim)
135 ptr = start + strlen(start);
136 else {
137 ptr = strpbrk(start, delim);
138 if (!ptr) {
139 *stringp = NULL;
140 return start;
141 }
142 }
143
144 *ptr = '\0';
145 *stringp = ptr + 1;
146
147 return start;
148}
149#endif