Fix bug in r_str_split_list() causing 1 length arrays for empty strings

This commit is contained in:
pancake 2022-09-07 02:34:40 +02:00 committed by pancake
parent 7cb084d2bf
commit 20b5ebf501

View File

@ -3380,7 +3380,9 @@ R_API RList *r_str_split_list(char *str, const char *c, int n) {
*e++ = 0;
}
r_str_trim (aux);
r_list_append (lst, aux);
if (*aux) {
r_list_append (lst, aux);
}
aux = e;
}
return lst;