diff options
author | Léo Gaspard <leo@gaspard.io> | 2017-03-15 22:16:04 +0100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2017-03-15 21:16:04 +0000 |
commit | da6619cffed4aae4da168a11ae46473ad397b07e (patch) | |
tree | 508e330bbcfdfc06a7e5ae7ede120eaee1b80a47 /lib/strings.nix | |
parent | e99bc64552fae15668ddcd98749e1ce4c4fe24f7 (diff) |
libs: make splitString also split last separator (#23851)
* libs: make splitString also split last separator
* libs: add tests for splitStrings
Diffstat (limited to 'lib/strings.nix')
-rw-r--r-- | lib/strings.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index 86af4d438344..eb3c2971ad59 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -291,7 +291,7 @@ rec { recurse = index: startAt: let cutUntil = i: [(substring startAt (i - startAt) s)]; in - if index < lastSearch then + if index <= lastSearch then if startWithSep index then let restartAt = index + sepLen; in cutUntil index ++ recurse restartAt restartAt |