Mercurial
diff dowa/d_string.c @ 112:d6d578b49a19
[PostDog] Got CRUD working.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Sun, 04 Jan 2026 11:38:44 -0800 |
| parents | 655ea0b661fd |
| children | a2720eac50ce |
line wrap: on
line diff
--- a/dowa/d_string.c Sun Jan 04 06:39:16 2026 -0800 +++ b/dowa/d_string.c Sun Jan 04 11:38:44 2026 -0800 @@ -20,7 +20,7 @@ char **Dowa_String_Split(char *from, char *token, int32 from_length, int32 token_length, Dowa_Arena *p_arena) { - if (!from || from[0] == '\n') + if (!from) return NULL; int32 *token_pos_arr = NULL; @@ -37,9 +37,7 @@ } if (curr_token_pointer == token_length) - { Dowa_Array_Push(token_pos_arr, i); - } } } @@ -54,17 +52,12 @@ char *val = Dowa_String_Slice(from, start, end, p_arena); if (p_arena) - { Dowa_Array_Push_Arena(splitted_strings, val, p_arena); - } else - { Dowa_Array_Push(splitted_strings, val); - } - if (i < num_tokens) { + if (i < num_tokens) start = token_pos_arr[i] + token_length; - } } Dowa_Array_Free(token_pos_arr);