1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Fix for `hostname-whitespace'; thanks to Justin Bradford.

[originally from svn r2080]
This commit is contained in:
Simon Tatham
2002-10-16 11:35:13 +00:00
parent 5bc8f34f58
commit a24d9d3029
4 changed files with 60 additions and 0 deletions

15
plink.c
View File

@ -458,6 +458,21 @@ int main(int argc, char **argv)
*/
cfg.host[strcspn(cfg.host, ":")] = '\0';
/*
* Remove any remaining whitespace from the hostname.
*/
{
int p1 = 0, p2 = 0;
while (cfg.host[p2] != '\0') {
if (cfg.host[p2] != ' ' && cfg.host[p2] != '\t') {
cfg.host[p1] = cfg.host[p2];
p1++;
}
p2++;
}
cfg.host[p1] = '\0';
}
if (!*cfg.remote_cmd_ptr)
flags |= FLAG_INTERACTIVE;