Merge branch 'master' of lain.church:emil/probotic

This commit is contained in:
Emil 2023-08-04 05:57:27 -06:00
commit 8605323aa8

View File

@ -82,10 +82,10 @@ str_split(char const * s, char c)
for (i = 1; s[i]; ++i)
{
if (s[i] == c && s[i - 1] != c)
if ((s[i + 1] == c || !s[i + 1]) && s[i] != c)
{
/* end of a token*/
ret[current_token_i] = strndup(s + token_start_i, i - token_start_i);
ret[current_token_i] = strndup(s + token_start_i, i - token_start_i + 1);
if (!ret[current_token_i])
{
split_clean(ret);