do not load XSCHEM_LIBRARY_PATH if options are given on cmdline

This commit is contained in:
stefan schippers 2024-04-19 13:55:25 +02:00
parent 531a19ce59
commit 6b54542ab4
4 changed files with 6 additions and 9 deletions

View File

@ -195,7 +195,7 @@ const char fopen_read_mode[] = "r";
/* ---------------------------------------------------------- */
/* Cmdline options (used at xinit, and then not used anymore) */
/* ---------------------------------------------------------- */
int cli_opt_argc;
int cli_opt_argc, cli_argc;
char **cli_opt_argv = NULL;
int cli_opt_netlist_type = 0;
int cli_opt_flat_netlist = 0;

View File

@ -104,8 +104,8 @@ int main(int argc, char **argv)
} else XCloseDisplay(display);
}
#endif
argc = process_options(argc, argv);
cli_argc = argc;
cli_opt_argc = process_options(argc, argv);
#ifdef __unix__
/* if invoked in background (and not invoked from a command pipeline) detach from console */
if(!fstat(0, &statbuf)) {
@ -125,9 +125,6 @@ int main(int argc, char **argv)
* using cli_opt_detach if no windowing exists (has_x == 0) is non sense so do nothing
*/
cli_opt_argc = argc;
cli_opt_argv = my_malloc(_ALLOC_ID_, cli_opt_argc * sizeof(char *));
for(i = 0; i < cli_opt_argc; ++i) {
cli_opt_argv[i] = NULL;

View File

@ -2816,7 +2816,6 @@ int Tcl_AppInit(Tcl_Interp *inter)
my_strncpy(xctx->sch_to_compare, abs_sym_path(cli_opt_diff, ""), S(xctx->sch_to_compare));
tclsetvar("compare_sch", "1");
}
if(cli_opt_filename[0]) {
char f[PATH_MAX];
int file_loaded = 1;
@ -2852,7 +2851,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
if(cli_opt_do_netlist) if(!file_loaded) tcleval("exit 1");
if(cli_opt_do_netlist) set_modify(-1); /* set tab/window title */
tclvareval("update_recent_file {", f, "}", NULL);
} else /* if(!cli_opt_filename[0]) */
} else if(cli_argc == 1) /* if(!cli_opt_filename[0]) */
{
char * tmp;
char fname[PATH_MAX];

View File

@ -1209,7 +1209,8 @@ extern char old_winpath[PATH_MAX]; /* previously switched window, used in callba
extern const char fopen_read_mode[]; /* "r" on unix, "rb" on windows */
/*********** Cmdline options (used at xinit, and then not used anymore) ***********/
extern int cli_opt_argc;
extern int cli_argc; /* copy of main argc */
extern int cli_opt_argc; /* arguments after stripping off options */
extern char **cli_opt_argv;
extern int cli_opt_netlist_type;
extern int cli_opt_flat_netlist;