fix regression (xschem load_new_window was not working anymore with web urls)

This commit is contained in:
stefan schippers 2024-05-12 23:52:05 +02:00
parent 6db52b125c
commit 5a32a77fd3
1 changed files with 8 additions and 4 deletions

View File

@ -2744,10 +2744,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
int cancel = 0;
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
if(argc > 2) {
my_snprintf(f, S(f),"regsub {^~/} {%s} {%s/}", argv[2], home_dir);
tcleval(f);
tclvareval("file normalize {", tclresult(), "}", NULL);
my_strncpy(f, abs_sym_path(tclresult(), ""), S(f));
if(!is_from_web(argv[2])) {
my_snprintf(f, S(f),"regsub {^~/} {%s} {%s/}", argv[2], home_dir);
tcleval(f);
tclvareval("file normalize {", tclresult(), "}", NULL);
my_strncpy(f, abs_sym_path(tclresult(), ""), S(f));
} else {
my_strncpy(f, argv[2], S(f));
}
} else {
tcleval("load_file_dialog {Load file} *.\\{sch,sym,tcl\\} INITIALLOADDIR");
if(tclresult()[0]) {