diff options
author | Araq <rumpf_a@web.de> | 2018-08-04 23:23:10 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-08-04 23:23:10 +0200 |
commit | c9f2c16da14357ee5f05efb890ebb141258ab061 (patch) | |
tree | 50d2449abfbe8a4c7154a25c405fc2f8e07265f7 /lib/system/sysstr.nim | |
parent | a18e40fa5fe3485eafb7d7e9cbac21190f4d94d7 (diff) | |
download | Nim-c9f2c16da14357ee5f05efb890ebb141258ab061.tar.gz |
make setLengthStr compile for the old version
Diffstat (limited to 'lib/system/sysstr.nim')
-rw-r--r-- | lib/system/sysstr.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index fe16e0d86..19c2c62ad 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -268,10 +268,9 @@ proc setLengthStr(s: NimString, newLen: int): NimString {.compilerRtl.} = result.len = s.len copyMem(addr result.data[0], unsafeAddr(s.data[0]), s.len+1) zeroMem(addr result.data[s.len], newLen - s.len) + result.reserved = sp else: - result = cast[NimString](growObj(dest, sizeof(TGenericSeq) + sp + 1)) - result.reserved = sp - #result = resizeString(s, n) + result = resizeString(s, n) result.len = n result.data[n] = '\0' |