Corrected an issue in which netgen would attempt to find a file

from a ".include" line by trying alternate extensions.  This
should be discouraged, as it happened that a file included
"name.defparams", a file that didn't exist, and instead of calling
out the missing file, it recast it to "name.spice" and caused it
to drop into an infinite loop.  Oops.
This commit is contained in:
Tim Edwards 2017-12-14 21:48:01 -05:00
parent e1322dbaf6
commit 87e44b0d8c
1 changed files with 8 additions and 5 deletions

View File

@ -1941,12 +1941,15 @@ void IncludeSpice(char *fname, int parent, struct cellstack **CellStackPtr,
if ((filenum = OpenParseFile(fname, parent)) < 0) {
/* If that fails, see if a standard SPICE extension */
/* helps. But really, we're getting desperate at this */
/* point. */
/* helps, if the file didn't have an extension. But */
/* really, we're getting desperate at this point. */
SetExtension(name, fname, SPICE_EXTENSION);
if ((filenum = OpenParseFile(name, parent)) < 0) {
Fprintf(stderr,"Error in SPICE file read: No file %s\n",name);
if (strchr(fname, '.') == NULL) {
SetExtension(name, fname, SPICE_EXTENSION);
filenum = OpenParseFile(name, parent);
}
if (filenum < 0) {
Fprintf(stderr,"Error in SPICE file include: No file %s\n",name);
return;
}
}