From 90abb74ff0e3134d8647722cee36b1815c14143d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 3 Nov 2017 15:04:53 +0200 Subject: curl: pass through [] in URLs instead of calling globbing error Assisted-by: Per Lundberg Fixes #2044 Closes #2046 Closes #2048 --- src/tool_urlglob.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tool_urlglob.c') diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index df85d7129..f78d058cd 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -367,9 +367,11 @@ static CURLcode glob_parse(URLGlob *glob, char *pattern, size_t sublen = 0; while(*pattern && *pattern != '{') { if(*pattern == '[') { - /* Skip over potential IPv6 literals. */ - size_t skip; - if(peek_ipv6(pattern, &skip)) { + /* skip over IPv6 literals and [] */ + size_t skip = 0; + if(!peek_ipv6(pattern, &skip) && (pattern[1] == ']')) + skip = 2; + if(skip) { memcpy(buf, pattern, skip); buf += skip; pattern += skip; -- cgit v1.2.3