]> asedeno.scripts.mit.edu Git - PuTTY.git/commit - misc.c
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)
commit0348f570771a0412609de947778cad9d5b3dca93
tree6fcbcece9d31228226779cd71aefc50b2c0bc914
parent041bc37dbc127a10b4f3f1db62d1241ea4985c4a
New hostname-handling functions in misc.c.

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]
misc.c
misc.h