Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2020-01-30 09:40:22 +0300
committerSimon Tatham <anakin@pobox.com>2020-01-30 09:40:22 +0300
commit575ee4f8fc2bf681d558a6197fc9cc17478abb47 (patch)
tree675885e069729baca7fee5a6fa23b16856370654 /psftp.c
parent9da36bd897533db6811fefb7954ff81ab2dfbb63 (diff)
Make cmdline_tooltype a const int.
Another ugly mutable global variable gone: now, instead of this variable being defined in cmdline.c and written to by everyone's main(), it's defined _alongside_ everyone's main() as a constant, and cmdline.c just refers to it. A bonus is that now nocmdline.c doesn't have to define it anyway for tools that don't use cmdline.c. But mostly, it didn't need to be mutable, so better for it not to be. While I'm at it, I've also fiddled with the bit flags that go in it, to define their values automatically using a list macro instead of manually specifying each one to be a different power of 2.
Diffstat (limited to 'psftp.c')
-rw-r--r--psftp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/psftp.c b/psftp.c
index 3b4b6eb3..a47599e3 100644
--- a/psftp.c
+++ b/psftp.c
@@ -2750,6 +2750,8 @@ const bool share_can_be_upstream = false;
static stdio_sink stderr_ss;
static StripCtrlChars *stderr_scc;
+const unsigned cmdline_tooltype = TOOLTYPE_FILETRANSFER;
+
/*
* Main program. Parse arguments etc.
*/
@@ -2763,7 +2765,6 @@ int psftp_main(int argc, char *argv[])
bool sanitise_stderr = true;
char *batchfile = NULL;
- cmdline_tooltype = TOOLTYPE_FILETRANSFER;
sk_init();
userhost = user = NULL;