diff options
author | Araq <rumpf_a@web.de> | 2018-08-21 20:33:47 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-08-21 20:33:47 +0200 |
commit | f12a5431a19ac80900fe049e3d44000b891e6273 (patch) | |
tree | c920445ca826bd8067080fb8adcc98dba324423c /lib/system.nim | |
parent | ddaf2e3805d58cc27244fa719fabee30543dec75 (diff) | |
download | Nim-f12a5431a19ac80900fe049e3d44000b891e6273.tar.gz |
make tests green again
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 52ed524be..832a98976 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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: |