diff options
| author | Jacob Friedman <jacobjf01@gmail.com> | 2025-02-04 15:09:12 +0100 |
|---|---|---|
| committer | Jacob Friedman <jacobjf01@gmail.com> | 2025-02-04 15:09:12 +0100 |
| commit | 239c511ce9e580384eca804596dfaf227f98c807 (patch) | |
| tree | 843edf0d67b2ee8593edd8a6e3193b2a8baec008 /core/strings/strings.odin | |
| parent | 0e1c89e99bcd31f58e12a0b13db5f83150f53e9f (diff) | |
Fix strings.split_iterator when separator is empty
Diffstat (limited to 'core/strings/strings.odin')
| -rw-r--r-- | core/strings/strings.odin | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/core/strings/strings.odin b/core/strings/strings.odin index c014d2b2b..9e7ea6ac1 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -1031,14 +1031,10 @@ Returns: */ @private _split_iterator :: proc(s: ^string, sep: string, sep_save: int) -> (res: string, ok: bool) { + m := index(s^, sep) if sep == "" { - res = s[:] - ok = true - s^ = s[len(s):] - return + m = 1 if len(s) > 0 else -1 } - - m := index(s^, sep) if m < 0 { // not found res = s[:] |