curl: stop interpreting IPv6 literals as glob patterns.
authorPaul Marks <pmarks@google.com>
Sun, 30 Mar 2014 05:50:37 +0000 (07:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 30 Mar 2014 21:45:29 +0000 (23:45 +0200)
commit0bc4938eecccefdf8906bf9c488e4cd9c8467e99
treeb6a82fdddea4cf18dd21ae49cde331435d855425
parent4043d7b67b6d4c03e8c529408edbe65bc66e5ae1
curl: stop interpreting IPv6 literals as glob patterns.

This makes it possible to fetch from an IPv6 literal without specifying
the -g option.  Globbing remains available elsehwere in the URL.

For example:
  curl http://[::1]/file[1-3].txt

This creates no ambiguity, because there is no overlap between the
syntax of valid globs and valid IPv6 literals.  Globs contain hyphens
and at most 1 colon, while IPv6 literals have no hyphens, and at least 2
colons.

The peek_ipv6() parser simply whitelists a set of characters and counts
colons, because the real validation happens later on.  The character set
includes A-Z, in case someone decides to implement support for scopes
like [fe80::1%25eth0] in the future.

Signed-off-by: Paul Marks <pmarks@google.com>
src/tool_urlglob.c
tests/data/test1230