allows to start ngspice WinGUI by double click on an input file, if

the file extension has been associated with ngspice.exe
This commit is contained in:
Holger Vogt 2018-10-18 21:37:50 +02:00
parent 5ee1be955c
commit ff2304625f
1 changed files with 6 additions and 0 deletions

View File

@ -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);