From: Alex Maestas Date: Wed, 24 Aug 2022 01:56:36 +0000 (+0000) Subject: Put brackets around ipv6 addresses in `inet6 present` X-Git-Tag: 0.99~1111 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=7290f87278b21b720d5550cbe4a835399c393811 Put brackets around ipv6 addresses in `inet6 present` --- diff --git a/basis/io/sockets/sockets-tests.factor b/basis/io/sockets/sockets-tests.factor index 3b98bed9ea..2cd2830181 100644 --- a/basis/io/sockets/sockets-tests.factor +++ b/basis/io/sockets/sockets-tests.factor @@ -37,8 +37,8 @@ os unix? [ ! Test present on addrspecs { "4.4.4.4:12" } [ "4.4.4.4" 12 present ] unit-test -{ "::1:12" } [ "::1" 12 present ] unit-test -{ "fe80::1%1:12" } [ "fe80::1" 1 12 inet6 boa present ] unit-test +{ "[::1]:12" } [ "::1" 12 present ] unit-test +{ "[fe80::1%1]:12" } [ "fe80::1" 1 12 inet6 boa present ] unit-test { B{ 1 2 3 4 } } [ "1.2.3.4" T{ inet4 } inet-pton ] unit-test diff --git a/basis/io/sockets/sockets.factor b/basis/io/sockets/sockets.factor index 8c40b0d980..9ffa6231ca 100644 --- a/basis/io/sockets/sockets.factor +++ b/basis/io/sockets/sockets.factor @@ -214,7 +214,7 @@ M: inet6 parse-sockaddr [ call-next-method ] [ drop port>> ntohs ] 2bi with-port ; M: inet6 present - [ call-next-method ] [ port>> number>string ] bi ":" glue ; + [ call-next-method "[" "]" surround ] [ port>> number>string ] bi ":" glue ; M: inet6 protocol drop 0 ;