X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=common.c;h=ce1b6c0305aa3b86b4754fdf7da5c46134dc09ad;hp=9dbadf369983950b2126efc8a5dcde63a307d2f2;hb=0a6b0889c67675bd71681ec41774d2ea57ce5335;hpb=4706199a81dc631b6969927e1a6ad27591852b20 diff --git a/common.c b/common.c index 9dbadf3..ce1b6c0 100644 --- a/common.c +++ b/common.c @@ -126,7 +126,11 @@ char *strqtok_r(char *str, const char *sep, int esc, const char *quote, char **l } /* next token starts after any leading seps */ - *lasts += strspn(*lasts, sep); + while (**lasts && strchr(sep, **lasts)) { + **lasts = '\0'; + (*lasts)++; + } + tok = *lasts; if (*tok == '\0') return NULL;