]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
New hostname-handling functions in misc.c.
authorSimon Tatham <anakin@pobox.com>
Sat, 25 Jan 2014 15:58:47 +0000 (15:58 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 25 Jan 2014 15:58:47 +0000 (15:58 +0000)
These are intended to make it easier to handle strings of the form
"hostname:port" or other colon-separated things including hostnames
(such as the -L and -R command-line option arguments), even though the
hostname part might be a square-bracketed IPv6 address literal
containing colons that have to _not_ be treated as separating the
top-level string components.

Three of these functions have semantics as much like existing C
library functions as I could make them (host_strchr, host_strrchr,
host_strcspn) so that it wouldn't be too error-prone to replace
existing C functions with them at lots of call sites. The fourth
function (host_strduptrim) just strips square brackets off anything
that looks like an IPv6 literal.

[originally from svn r10119]


No differences found