You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sci-electronics/ngspice/files/ngspice-27-fix_parsing_tcl_...

17 lines
448 B

--- a/src/tclspice.c
+++ b/src/tclspice.c
@@ -828,10 +828,9 @@
int i;
NG_IGNORE(clientData);
save_interp();
- /* Looks backwards through the first command and strips the :: part */
- for (i = strlen(argv[0])-1; i > 0; i--)
- if (argv[0][i] == *":")
- argv[0] += i + 1;
+ char *prefix = strstr(argv[0], "spice::");
+ if (prefix)
+ argv[0] = prefix + 7;
return _run(argc, (char **)argv);
}