From 2a2153f4ced735bb75c87776c6b062b9b68679b4 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 8 Dec 2017 19:34:35 +0000 Subject: [PATCH] Fix assertion failure that prevents pterm starting up. When testing the previous commit, I went to great lengths to check all the tricky corner cases of the detailed command-line argument handling in Plink and PuTTY, on Windows and Unix. And did I also double-check that I had not completely broken the very simplest possible invocation of pterm? I did not. The call to cmdline_host_ok() in gtkmain.c was failing an assertion in pterm, because that function only expects to have been called by a program that has the TOOLTYPE_HOST_ARG flag set - if that flag isn't set, the program is expected to come up with its own answer to the question (because I wasn't sure what the right fallback answer would be). And I forgot to conditionalise the call between PuTTY and pterm. --- unix/gtkmain.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unix/gtkmain.c b/unix/gtkmain.c index bd9a8e31..67581604 100644 --- a/unix/gtkmain.c +++ b/unix/gtkmain.c @@ -646,7 +646,10 @@ int main(int argc, char **argv) cmdline_run_saved(conf); - need_config_box = !cmdline_host_ok(conf); + if (cmdline_tooltype & TOOLTYPE_HOST_ARG) + need_config_box = !cmdline_host_ok(conf); + else + need_config_box = FALSE; } if (need_config_box) {