Added StrSep function.
This commit is contained in:
parent
07407927c2
commit
d6e1a0a25f
@ -186,6 +186,8 @@ WINPR_API void ByteSwapUnicode(WCHAR* wstr, int length);
|
||||
WINPR_API int ConvertLineEndingToLF(char* str, int size);
|
||||
WINPR_API char* ConvertLineEndingToCRLF(const char* str, int* size);
|
||||
|
||||
WINPR_API char* StrSep(char** stringp, const char* delim);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -463,3 +463,22 @@ char* ConvertLineEndingToCRLF(const char* str, int* size)
|
||||
return newStr;
|
||||
}
|
||||
|
||||
char* StrSep(char** stringp, const char* delim)
|
||||
{
|
||||
char* start = *stringp;
|
||||
char* p;
|
||||
|
||||
p = (start != NULL) ? strpbrk(start, delim) : NULL;
|
||||
|
||||
if (!p)
|
||||
*stringp = NULL;
|
||||
else
|
||||
{
|
||||
*p = '\0';
|
||||
*stringp = p + 1;
|
||||
}
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user