From 52b24190285c79b8534cc8f64e1dc321e3f1768d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 21 Nov 2024 12:39:04 +0000 Subject: [PATCH] Make the -legacy-foo options not SAVEABLE. They weren't being enacted if you ran psftp without a hostname and later issued an 'open' command, because in that code path, cmdline_run_saved() was never called. Without SAVEABLE, the options are processed immediately instead of being deferred for later. Also, it's pointless. The purpose of marking command-line options as SAVEABLE is so that their processing can be correctly ordered with respect to loading a saved session, so that they can reliably override settings that the saved session might have defined another way. (E.g. "plink -A sessionname": processing those options in strict left-to-right order, the saved session's opinion about agent forwarding would be used, regardless of the -A option.) So anything that's not stored in Conf (and hence the saved session) at all doesn't have any reason to be SAVEABLE. I think I must have put the SAVEABLE in by thoughtless clone-and-hack. --- cmdline.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmdline.c b/cmdline.c index 5e507af6..5de30f7f 100644 --- a/cmdline.c +++ b/cmdline.c @@ -926,7 +926,6 @@ int cmdline_process_param(CmdlineArg *arg, CmdlineArg *nextarg, if (!strcmp(p, "-legacy-stdio-prompts") || !strcmp(p, "-legacy_stdio_prompts")) { RETURN(1); - SAVEABLE(0); if (!console_set_stdio_prompts(true)) { cmdline_report_unavailable(p); return ret; @@ -936,7 +935,6 @@ int cmdline_process_param(CmdlineArg *arg, CmdlineArg *nextarg, if (!strcmp(p, "-legacy-charset-handling") || !strcmp(p, "-legacy_charset_handling")) { RETURN(1); - SAVEABLE(0); if (!set_legacy_charset_handling(true)) { cmdline_report_unavailable(p); return ret;