chiark / gitweb /
addr-family-ipv6.lisp (ipaddr-string): Ignore trivial runs of zeros.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Apr 2014 13:14:24 +0000 (14:14 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 22 Apr 2014 13:41:05 +0000 (14:41 +0100)
It seems that the convention is to write addresses out longhand if they
have only isolated zero components.  So do that here too.

addr-family-ipv6.lisp

index e9dd1aa5e0d263095bd8eb79201d9b1b5d8c686c..5ed014e22ac8f953366bb12a2bc212cfb073d6fd 100644 (file)
@@ -168,7 +168,7 @@ (defmethod ipaddr-string ((ip ip6addr))
                     (incf i)
                     (when (>= i end) (return))
                     (write-char #\: out))))))
-       (cond ((null best-start)
+       (cond ((< best-length 2)
               (chunk 0 8))
              ((and (= best-start 0)
                    (or (and (= best-length 5)