From 796785abf632d25f5ee43b52df7a0695d9c3e42a Mon Sep 17 00:00:00 2001 From: rockcavera Date: Sun, 25 Oct 2020 04:29:57 -0300 Subject: [PATCH] fix #15698 (#15699) * fix in the net.`$` to print zeros that are not in the compressed group * Update lib/pure/net.nim Co-authored-by: Andreas Rumpf * Update net.nim Co-authored-by: Andreas Rumpf (cherry picked from commit 7252a50fefb844d97ad4630c1db00063380ff3c4) --- lib/pure/net.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 3ef41aa3c4..cd509463a2 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -1827,6 +1827,10 @@ proc `$`*(address: IpAddress): string = result.add(chr(uint16(ord('a'))+val-0xA)) afterLeadingZeros = true mask = mask shr 4 + + if not afterLeadingZeros: + result.add '0' + printedLastGroup = true proc dial*(address: string, port: Port,