summary refs log tree commit diff stats
path: root/lib/system/sysstr.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-04 23:23:10 +0200
committerAraq <rumpf_a@web.de>2018-08-04 23:23:10 +0200
commitc9f2c16da14357ee5f05efb890ebb141258ab061 (patch)
tree50d2449abfbe8a4c7154a25c405fc2f8e07265f7 /lib/system/sysstr.nim
parenta18e40fa5fe3485eafb7d7e9cbac21190f4d94d7 (diff)
downloadNim-c9f2c16da14357ee5f05efb890ebb141258ab061.tar.gz
make setLengthStr compile for the old version
Diffstat (limited to 'lib/system/sysstr.nim')
-rw-r--r--lib/system/sysstr.nim5
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'