summary refs log tree commit diff stats
path: root/src/nre.nim
diff options
context:
space:
mode:
authorOleh Prypin <blaxpirit@gmail.com>2015-04-10 00:19:00 +0300
committerOleh Prypin <blaxpirit@gmail.com>2015-04-10 00:19:00 +0300
commit1fe69b94c9bc4ace9b4f0a6c105ffd4d12b877b9 (patch)
treec1c9062b8ac4e5e7b2bb41ebda517619b6aed6c9 /src/nre.nim
parent6c213802f0d78faccfbc8a0e10a9720834b6f195 (diff)
downloadNim-1fe69b94c9bc4ace9b4f0a6c105ffd4d12b877b9.tar.gz
Make splitting an empty string give 1 empty result
Diffstat (limited to 'src/nre.nim')
-rw-r--r--src/nre.nim2
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: