mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-21 13:05:04 -05:00
Reinstate a piece of code accidentally removed in r9214, where Windows
PuTTY does not trim a colon suffix off the hostname if it contains _more than one_ colon. This allows IPv6 literals to be entered. (Really we need to do a much bigger revamp of all uses of hostnames to arrange that square-bracketed IPv6 literals work consistently, but this at least removes a regression over 0.62.) [originally from svn r9983] [r9214 == a1f3b7a358adaa7c2a98359cd0373aa823eeb14b]
This commit is contained in:
parent
fd266a3cec
commit
ba49faec3d
@ -617,10 +617,21 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Trim off a colon suffix if it's there.
|
* Trim a colon suffix off the hostname if it's there. In
|
||||||
*/
|
* order to protect IPv6 address literals against this
|
||||||
host[strcspn(host, ":")] = '\0';
|
* treatment, we do not do this if there's _more_ than one
|
||||||
|
* colon.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
char *c = strchr(host, ':');
|
||||||
|
|
||||||
|
if (c) {
|
||||||
|
char *d = strchr(c+1, ':');
|
||||||
|
if (!d)
|
||||||
|
*c = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove any remaining whitespace.
|
* Remove any remaining whitespace.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user