From ff2304625fb8b5d2666d03ec74fea4d5a7900229 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Thu, 18 Oct 2018 21:37:50 +0200 Subject: [PATCH] allows to start ngspice WinGUI by double click on an input file, if the file extension has been associated with ngspice.exe --- src/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.c b/src/main.c index 2b213eb3b..b9460bb21 100644 --- a/src/main.c +++ b/src/main.c @@ -1229,6 +1229,10 @@ main(int argc, char **argv) if (!Infile_Path) Infile_Path = ngdirname(arg); + /* unquote the input string, needed if it results from double clicking the filename */ +#if defined(HAS_WINGUI) + arg = cp_unquote(arg); +#endif /* Copy all the arguments into the temporary file */ tp = fopen(arg, "r"); if (!tp) { @@ -1253,6 +1257,8 @@ main(int argc, char **argv) #if defined(HAS_WINGUI) /* write source file name into source window */ SetSource(dname); + /* free arg that has been unquoted above */ + tfree(arg); #endif append_to_stream(tempfile, tp);