[vlc-commits] ftp: add missing brackets for IPv6 literals
Rémi Denis-Courmont
git at videolan.org
Sun Jan 10 12:50:55 UTC 2021
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 10 14:08:42 2021 +0200| [7c10ffdd52ac543ff0d7d3df84c5ef652170f321] | committer: Rémi Denis-Courmont
ftp: add missing brackets for IPv6 literals
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7c10ffdd52ac543ff0d7d3df84c5ef652170f321
---
modules/access/ftp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index f0157c66d5..593cf942df 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -979,7 +979,11 @@ static int DirRead (stream_t *p_access, input_item_node_t *p_current_node)
vlc_memstream_putc(&ms, 's');
}
vlc_memstream_puts(&ms, "://");
- vlc_memstream_puts(&ms, p_sys->url.psz_host);
+
+ if (strchr(p_sys->url.psz_host, ':') != NULL)
+ vlc_memstream_printf(&ms, "[%s]", p_sys->url.psz_host);
+ else
+ vlc_memstream_puts(&ms, p_sys->url.psz_host);
if (p_sys->url.i_port != ((p_sys->tlsmode != IMPLICIT) ? IPPORT_FTP
: IPPORT_FTPS))
More information about the vlc-commits
mailing list