mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-04 04:52:47 -05:00
Rationalise access to, and content of, backends[] array.
Should be no significant change in behaviour. (Well, entering usernames containing commas on Plink's command line will be a little harder now.) [originally from svn r7628]
This commit is contained in:
@ -210,13 +210,10 @@ static void mac_startup(void) {
|
||||
default_protocol = be_default_protocol;
|
||||
/* Find the appropriate default port. */
|
||||
{
|
||||
int i;
|
||||
Backend *b = backend_from_proto(default_protocol);
|
||||
default_port = 0; /* illegal */
|
||||
for (i = 0; backends[i].backend != NULL; i++)
|
||||
if (backends[i].protocol == default_protocol) {
|
||||
default_port = backends[i].backend->default_port;
|
||||
break;
|
||||
}
|
||||
if (b)
|
||||
default_port = b->default_port;
|
||||
}
|
||||
flags = FLAG_INTERACTIVE;
|
||||
|
||||
|
@ -115,12 +115,7 @@ void mac_startsession(Session *s)
|
||||
* Select protocol. This is farmed out into a table in a
|
||||
* separate file to enable an ssh-free variant.
|
||||
*/
|
||||
s->back = NULL;
|
||||
for (i = 0; backends[i].backend != NULL; i++)
|
||||
if (backends[i].protocol == s->cfg.protocol) {
|
||||
s->back = backends[i].backend;
|
||||
break;
|
||||
}
|
||||
s->back = backend_from_proto(s->cfg.protocol);
|
||||
if (s->back == NULL)
|
||||
fatalbox("Unsupported protocol number found");
|
||||
|
||||
|
Reference in New Issue
Block a user