diff -u ../../liblo-0.18/src/address.c ./address.c --- ../../liblo-0.18/src/address.c 2005-03-03 06:15:47.000000000 +1100 +++ ./address.c 2005-08-18 20:11:53.000000000 +1000 @@ -171,7 +171,7 @@ "assuming UDP.\n"); return strdup("udp"); } - if (sscanf(url, "osc.%[^:/]", protocol)) { + if (sscanf(url, "osc.%[^:/[]", protocol)) { return strdup(protocol); } @@ -208,6 +208,12 @@ if (sscanf(url, "osc.%*[^:]://%*[^:]:%[0-9]", port)) { return port; } + if (sscanf(url, "osc://[%*[^]]]:%[0-9]", port)) { + return port; + } + if (sscanf(url, "osc.%*[^:]://[%*[^]]]:%[0-9]", port)) { + return port; + } /* doesnt look like an OSC URL with port number */ free(port); diff -u ../../liblo-0.18/src/testlo.c ./testlo.c --- ../../liblo-0.18/src/testlo.c 2005-03-03 06:15:47.000000000 +1100 +++ ./testlo.c 2005-08-18 20:13:51.000000000 +1000 @@ -191,6 +191,16 @@ printf("passed lo_url_get_protocol() test\n"); } free(protocol); + + protocol = lo_url_get_protocol("osc.udp://[::ffff:localhost]:9999/a/path/is/here"); + if (strcmp(protocol, "udp")) { + printf("failed lo_url_get_protocol() test1\n"); + printf("'%s' != 'udp'\n", protocol); + exit(1); + } else { + printf("passed lo_url_get_protocol() test (IPv6)\n"); + } + free(protocol); host = lo_url_get_hostname("osc.udp://foo.example.com:9999/a/path/is/here"); if (strcmp(host, "foo.example.com")) { @@ -221,6 +231,16 @@ printf("passed lo_url_get_port() test\n"); } free(port); + + port = lo_url_get_port("osc.udp://[::ffff:127.0.0.1]:9999/a/path/is/here"); + if (strcmp(port, "9999")) { + printf("failed lo_url_get_port() test1\n"); + printf("'%s' != '9999'\n", port); + exit(1); + } else { + printf("passed lo_url_get_port() test (IPv6)\n"); + } + free(port); printf("\n");