diff options
author | Hans Raaf <hara@oderwat.de> | 2016-07-29 01:39:33 +0200 |
---|---|---|
committer | Hans Raaf <hara@oderwat.de> | 2016-07-29 01:39:33 +0200 |
commit | cc4bb892671c039c2a5c91c21a27f1a055eb4b10 (patch) | |
tree | c99ef9e3306108e8aec445a8c593573307cb0ffc /lib | |
parent | f18ff6a033643dc861002b18124feafb52cedfd3 (diff) | |
download | Nim-cc4bb892671c039c2a5c91c21a27f1a055eb4b10.tar.gz |
Fix for cstring nil to string nil conversion with `$`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system/sysstr.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim index 569470aa2..eb3d276e0 100644 --- a/lib/system/sysstr.nim +++ b/lib/system/sysstr.nim @@ -85,7 +85,8 @@ proc toNimStr(str: cstring, len: int): NimString {.compilerProc.} = copyMem(addr(result.data), str, len + 1) proc cstrToNimstr(str: cstring): NimString {.compilerRtl.} = - result = toNimStr(str, str.len) + if str == nil: NimString(nil) + else: toNimStr(str, str.len) proc copyString(src: NimString): NimString {.compilerRtl.} = if src != nil: |