diff --git a/pscp.c b/pscp.c index e6935fc7..916d829c 100644 --- a/pscp.c +++ b/pscp.c @@ -43,7 +43,7 @@ static bool using_sftp = false; static bool uploading = false; static Backend *backend; -Conf *conf; +static Conf *conf; bool sent_eof = false; static void source(const char *src); diff --git a/psftp.c b/psftp.c index 0567144f..1fee4e3d 100644 --- a/psftp.c +++ b/psftp.c @@ -35,7 +35,7 @@ static void do_sftp_cleanup(void); char *pwd, *homedir; static LogContext *psftp_logctx = NULL; static Backend *backend; -Conf *conf; +static Conf *conf; bool sent_eof = false; /* ------------------------------------------------------------ diff --git a/unix/uxplink.c b/unix/uxplink.c index f75b04ce..b1aa1bf4 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -39,7 +39,7 @@ void cmdline_error(const char *fmt, ...) static bool local_tty = false; /* do we have a local tty? */ static Backend *backend; -Conf *conf; +static Conf *conf; /* * Default settings that are specific to Unix plink. diff --git a/windows/windlg.c b/windows/windlg.c index d2704520..1b755b7b 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -694,7 +694,7 @@ void defuse_showwindow(void) } } -bool do_config(void) +bool do_config(Conf *conf) { bool ret; @@ -724,7 +724,7 @@ bool do_config(void) return ret; } -bool do_reconfig(HWND hwnd, int protcfginfo) +bool do_reconfig(HWND hwnd, Conf *conf, int protcfginfo) { Conf *backup_conf; bool ret; diff --git a/windows/window.c b/windows/window.c index 59259703..5accaf22 100644 --- a/windows/window.c +++ b/windows/window.c @@ -145,6 +145,8 @@ static struct { enum { SYSMENU, CTXMENU }; static HMENU savedsess_menu; +static Conf *conf; + struct wm_netevent_params { /* Used to pass data to wm_netevent_callback */ WPARAM wParam; @@ -577,7 +579,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) i--; p[i] = '\0'; do_defaults(p + 1, conf); - if (!conf_launchable(conf) && !do_config()) { + if (!conf_launchable(conf) && !do_config(conf)) { cleanup_exit(0); } special_launchable_argument = true; @@ -600,7 +602,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) modalfatalbox("Serialised configuration data was invalid"); UnmapViewOfFile(cp); CloseHandle(filemap); - } else if (!do_config()) { + } else if (!do_config(conf)) { cleanup_exit(0); } special_launchable_argument = true; @@ -672,7 +674,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) * (explicitly) specified a launchable configuration. */ if (!(special_launchable_argument || cmdline_host_ok(conf))) { - if (!do_config()) + if (!do_config(conf)) cleanup_exit(0); } @@ -2326,8 +2328,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, prev_conf = conf_copy(conf); - reconfig_result = - do_reconfig(hwnd, backend ? backend_cfg_info(backend) : 0); + reconfig_result = do_reconfig( + hwnd, conf, backend ? backend_cfg_info(backend) : 0); reconfiguring = false; if (!reconfig_result) { conf_free(prev_conf); diff --git a/windows/winplink.c b/windows/winplink.c index 936835bd..794aa925 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -30,7 +30,7 @@ BinarySink *stdout_bs, *stderr_bs; DWORD orig_console_mode; static Backend *backend; -Conf *conf; +static Conf *conf; static void plink_echoedit_update(Seat *seat, bool echo, bool edit) { diff --git a/windows/winstuff.h b/windows/winstuff.h index 25afd554..7857e623 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -235,7 +235,6 @@ int has_embedded_chm(void); /* 1 = yes, 0 = no, -1 = N/A */ */ GLOBAL Terminal *term; GLOBAL LogContext *logctx; -GLOBAL Conf *conf; /* * GUI seat methods in windlg.c, so that the vtable definition in @@ -569,8 +568,8 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, bool has_help, * Exports from windlg.c. */ void defuse_showwindow(void); -bool do_config(void); -bool do_reconfig(HWND, int); +bool do_config(Conf *); +bool do_reconfig(HWND, Conf *, int); void showeventlog(HWND); void showabout(HWND); void force_normal(HWND hwnd);