diff options
author | Simon Tatham <anakin@pobox.com> | 2020-01-30 09:40:22 +0300 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2020-01-30 09:40:22 +0300 |
commit | 575ee4f8fc2bf681d558a6197fc9cc17478abb47 (patch) | |
tree | 675885e069729baca7fee5a6fa23b16856370654 /cmdline.c | |
parent | 9da36bd897533db6811fefb7954ff81ab2dfbb63 (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 'cmdline.c')
-rw-r--r-- | cmdline.c | 12 |
1 files changed, 0 insertions, 12 deletions
@@ -109,18 +109,6 @@ int cmdline_get_passwd_input(prompts_t *p) return 1; } -/* - * Here we have a flags word which describes the capabilities of - * the particular tool on whose behalf we're running. We will - * refuse certain command-line options if a particular tool - * inherently can't do anything sensible. For example, the file - * transfer tools (psftp, pscp) can't do a great deal with protocol - * selections (ever tried running scp over telnet?) or with port - * forwarding (even if it wasn't a hideously bad idea, they don't - * have the select/poll infrastructure to make them work). - */ -int cmdline_tooltype = 0; - static bool cmdline_check_unavailable(int flag, const char *p) { if (cmdline_tooltype & flag) { |