typelib: Fix logic error in previous commit

This commit is contained in:
Colin Walters 2013-04-08 14:44:32 -04:00
parent f84db0d30d
commit d0462e6a3c

View File

@ -252,11 +252,16 @@ strsplit_iter_next (StrSplitIter *iter,
if (!s)
return FALSE;
next = strstr (s, iter->separator);
iter->s = next;
if (next)
len = next - s;
{
iter->s = next + 1;
len = next - s;
}
else
len = strlen (s);
{
iter->s = NULL;
len = strlen (s);
}
g_string_overwrite_len (&iter->buf, 0, s, (gssize)len);
*out_val = iter->buf.str;
return TRUE;