Browse Source

add Inp_Path to sourcepath variable

Patch provided by Uros Platise
https://sourceforge.net/p/ngspice/ngspice/merge-requests/4/
pre-master-46
Holger Vogt 8 years ago
parent
commit
7c90004921
  1. 10
      src/frontend/inpcom.c

10
src/frontend/inpcom.c

@ -995,6 +995,16 @@ inp_read(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile)
}
}
} else {
/* add Inp_Path to sourcepath variable */
char *p;
if ((p = strstr(buffer, "sourcepath"))) {
if ((p = strchr(buffer, ')'))) {
*p = 0; // clear ) and insert Inp_Path in between
p = tprintf("%s %s ) %s", buffer, Inp_Path ? Inp_Path : "", p + 1);
tfree(buffer);
buffer = p;
}
}
/* exclude commands listed above to preserve filename case */
for (s = buffer; *s && (*s != '\n'); s++)
;

Loading…
Cancel
Save