* fix in the net.`$` to print zeros that are not in the compressed group

* Update lib/pure/net.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

* Update net.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
rockcavera 2020-10-25 04:29:57 -03:00 • committed by GitHub
commit 7252a50fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1827,6 +1827,10 @@ proc `$`*(address: IpAddress): string =
result.add(chr(uint16(ord('a'))+val-0xA)) result.add(chr(uint16(ord('a'))+val-0xA))
afterLeadingZeros = true afterLeadingZeros = true
mask = mask shr 4 mask = mask shr 4
if not afterLeadingZeros:
result.add '0'
printedLastGroup = true printedLastGroup = true
proc dial*(address: string, port: Port, proc dial*(address: string, port: Port,