1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 20:42:48 -05:00

Move 'loaded_session' into cmdline.c.

I haven't managed to make this one _not_ be a mutable variable, but at
least it's not global across all tools any more: it lives in cmdline.c
along with the code that decides what to set it to, and cmdline.c
exports a query method to ask for its value.
This commit is contained in:
Simon Tatham
2020-01-30 06:40:22 +00:00
parent 492e6b1187
commit 22deebfc3e
6 changed files with 5 additions and 11 deletions

View File

@ -2568,7 +2568,7 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
* If we haven't loaded session details already (e.g., from -load),
* try looking for a session called "host".
*/
if (!loaded_session) {
if (!cmdline_loaded_session()) {
/* Try to load settings for `host' into a temporary config */
Conf *conf2 = conf_new();
conf_set_str(conf2, CONF_host, "");
@ -2772,7 +2772,6 @@ int psftp_main(int argc, char *argv[])
/* Load Default Settings before doing anything else. */
conf = conf_new();
do_defaults(NULL, conf);
loaded_session = false;
for (i = 1; i < argc; i++) {
int ret;