From a49f02a835ac8b983b35918ba83aa75bae0887d1 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:23:34 +0800 Subject: [PATCH] progress --- lib/system/sysstr.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index fdd3fbc4a7..3ddf192c16 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -115,10 +115,13 @@ proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} = else: toNimStr(str, str.len) proc moveString(src: NimString): NimString {.compilerRtl.} = - if (src.reserved and strlitFlag) != 0: - result = toOwnedCopy(src) - else: + if src == nil: result = src + else: + if (src.reserved and strlitFlag) != 0: + result = toOwnedCopy(src) + else: + result = src proc copyString(src: NimString): NimString {.compilerRtl.} = ## Expects `src` to be initialized (len and terminating zero set)