make tests green again

This commit is contained in:
Araq 2018-08-21 20:33:47 +02:00
commit f12a5431a1
3 changed files with 3 additions and 5 deletions

View file

@ -4112,6 +4112,7 @@ template once*(body: untyped): untyped =
{.pop.} #{.push warning[GcMem]: off, warning[Uninit]: off.}
proc substr*(s: string, first, last: int): string =
let first = max(first, 0)
let L = max(min(last, high(s)) - first + 1, 0)
result = newString(L)
for i in 0 .. L-1: