diff options
author | Araq <rumpf_a@web.de> | 2015-08-02 02:16:45 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-02 02:56:02 +0200 |
commit | f9750781c04cf0f2f278ef4ce8734ba9bc3e859c (patch) | |
tree | 97159a5cc7166baf86d250e54d12e24cae4e124b | |
parent | ea35cede8e99b936c4a3003640844335001fe0b3 (diff) | |
download | Nim-f9750781c04cf0f2f278ef4ce8734ba9bc3e859c.tar.gz |
fixes #3080
-rw-r--r-- | lib/system/repr.nim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/system/repr.nim b/lib/system/repr.nim index 74396f424..b4188527f 100644 --- a/lib/system/repr.nim +++ b/lib/system/repr.nim @@ -256,7 +256,10 @@ when not defined(useNimRtl): of tyBool: add result, reprBool(cast[ptr bool](p)[]) of tyChar: add result, reprChar(cast[ptr char](p)[]) of tyString: reprStrAux(result, cast[ptr string](p)[]) - of tyCString: reprStrAux(result, $(cast[ptr cstring](p)[])) + of tyCString: + let cs = cast[ptr cstring](p)[] + if cs.isNil: add result, "nil" + else: reprStrAux(result, $cs) of tyRange: reprAux(result, p, typ.base, cl) of tyProc, tyPointer: if cast[PPointer](p)[] == nil: add result, "nil" |