diff options
author | Oleh Prypin <blaxpirit@gmail.com> | 2015-04-10 00:19:00 +0300 |
---|---|---|
committer | Oleh Prypin <blaxpirit@gmail.com> | 2015-04-10 00:19:00 +0300 |
commit | 1fe69b94c9bc4ace9b4f0a6c105ffd4d12b877b9 (patch) | |
tree | c1c9062b8ac4e5e7b2bb41ebda517619b6aed6c9 /src/nre.nim | |
parent | 6c213802f0d78faccfbc8a0e10a9720834b6f195 (diff) | |
download | Nim-1fe69b94c9bc4ace9b4f0a6c105ffd4d12b877b9.tar.gz |
Make splitting an empty string give 1 empty result
Diffstat (limited to 'src/nre.nim')
-rw-r--r-- | src/nre.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nre.nim b/src/nre.nim index af5dab785..f9c6b3509 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -387,7 +387,7 @@ proc split*(str: string, pattern: Regex, maxSplit = -1, start = 0): seq[string] result = @[] var lastIdx = start var splits = 0 - var bounds = 0 .. -1 + var bounds = 0 .. 0 for match in str.findIter(pattern, start = start): # bounds are inclusive: |