mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-11 08:08:06 -05:00
Enable PuTTY command line to deal with "user@host" format
[originally from svn r620]
This commit is contained in:
parent
cbdd9b3ac5
commit
117fd9affc
13
window.c
13
window.c
@ -229,6 +229,19 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* See if host is of the form user@host */
|
||||
if (cfg.host[0] != '\0') {
|
||||
char *atsign = strchr(cfg.host, '@');
|
||||
/* Make sure we're not overflowing the user field */
|
||||
if (atsign) {
|
||||
if (atsign-cfg.host < sizeof cfg.username) {
|
||||
strncpy (cfg.username, cfg.host, atsign-cfg.host);
|
||||
cfg.username[atsign-cfg.host] = '\0';
|
||||
}
|
||||
memmove(cfg.host, atsign+1, 1+strlen(atsign+1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user