X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=common.c;h=ce1b6c0305aa3b86b4754fdf7da5c46134dc09ad;hp=9dbadf369983950b2126efc8a5dcde63a307d2f2;hb=8e7b08b2dd8bb2d45aeec0034e55aff729b1f12a;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;