]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commit
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)
commit699ae7589a04b9730823697e6fe8f95e7506db95
tree6fcbcece9d31228226779cd71aefc50b2c0bc914
parent3d3a786e83910454ad902697b1eddfbaefebba96
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.

git-svn-id: http://svn.tartarus.org/sgt/putty@10119 cda61777-01e9-0310-a592-d414129be87e
misc.c
misc.h