mirror of
https://github.com/strongswan/strongswan.git
synced 2025-12-15 00:00:26 -05:00
extract_token() now handles whitespace
This commit is contained in:
parent
36fecdb8a3
commit
33eb3d4ab6
@ -48,6 +48,14 @@ bool extract_token(chunk_t *token, const char termination, chunk_t *src)
|
|||||||
{
|
{
|
||||||
u_char *eot = memchr(src->ptr, termination, src->len);
|
u_char *eot = memchr(src->ptr, termination, src->len);
|
||||||
|
|
||||||
|
if (termination == ' ')
|
||||||
|
{
|
||||||
|
u_char *eot_tab = memchr(src->ptr, '\t', src->len);
|
||||||
|
|
||||||
|
/* check if a tab instead of a space terminates the token */
|
||||||
|
eot = ( eot_tab == NULL || (eot && eot < eot_tab) ) ? eot : eot_tab;
|
||||||
|
}
|
||||||
|
|
||||||
/* initialize empty token */
|
/* initialize empty token */
|
||||||
*token = chunk_empty;
|
*token = chunk_empty;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user