Sign in
fuchsia
/
fuchsia
/
refs/heads/releases/canary
/
.
/
zircon
/
third_party
/
ulib
/
musl
/
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
;
}