mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:13:36 +03:00
curl: pass through [] in URLs instead of calling globbing error
Assisted-by: Per Lundberg Fixes #2044 Closes #2046 Closes #2048
This commit is contained in:
parent
921bf1de52
commit
90abb74ff0
3 changed files with 54 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue