Sign in
mojo
/
mojo-tools
/
b3a28bec1abb6642ddf21b21406c6666fb821438
/
.
/
fusl
/
src
/
string
/
strsep.c
blob: 2170f1ce0308936e1e939d12a38d0246c9c628e5 [
file
] [
log
] [
blame
]
#define
_GNU_SOURCE
#include
<string.h>
char
*
strsep
(
char
**
str
,
const
char
*
sep
)
{
char
*
s
=
*
str
,
*
end
;
if
(!
s
)
return
NULL
;
end
=
s
+
strcspn
(
s
,
sep
);
if
(*
end
)
*
end
++
=
0
;
else
end
=
0
;
*
str
=
end
;
return
s
;
}