summary refs log tree commit diff stats
path: root/lib/system/sysstr.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-24 02:17:14 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-24 02:27:12 +0200
commit66bbf7518e652bfe963f0891a55f45c4711d8be3 (patch)
tree409527338b7e0ca16e3e4f080fa7e9eaaa9ad676 /lib/system/sysstr.nim
parentbc53d2c9ded45e790a8424660ff6152b3876fdab (diff)
downloadNim-66bbf7518e652bfe963f0891a55f45c4711d8be3.tar.gz
fixes #4776
Diffstat (limited to 'lib/system/sysstr.nim')
-rw-r--r--lib/system/sysstr.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim
index 3e170172b..3a93221e0 100644
--- a/lib/system/sysstr.nim
+++ b/lib/system/sysstr.nim
@@ -110,6 +110,11 @@ proc copyStringRC1(src: NimString): NimString {.compilerRtl.} =
     result.len = src.len
     copyMem(addr(result.data), addr(src.data), src.len + 1)
 
+proc copyDeepString(src: NimString): NimString {.inline.} =
+  if src != nil:
+    result = rawNewStringNoInit(src.len)
+    result.len = src.len
+    copyMem(addr(result.data), addr(src.data), src.len + 1)
 
 proc hashString(s: string): int {.compilerproc.} =
   # the compiler needs exactly the same hash function!