diff --git a/VERSION b/VERSION index 33d1d865..0cea723e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.421 +8.3.422 diff --git a/extflat/EFread.c b/extflat/EFread.c index 9ea115ba..0d472350 100644 --- a/extflat/EFread.c +++ b/extflat/EFread.c @@ -623,13 +623,39 @@ resistChanged: break; } } - (void) fclose(inf); + fclose(inf); + inf = (FILE *)NULL; /* Is there an "extresist" extract file? */ if (DoResist) { DoResist = FALSE; /* do this only once */ - inf = PaOpen(name, "r", ".res.ext", EFSearchPath, EFLibPath, &efReadFileName); + if (EFSearchPath != NULL) + inf = PaOpen(name, "r", ".res.ext", EFSearchPath, + EFLibPath, &efReadFileName); + + if ((inf == NULL) && (dbdef = DBCellLookDef(name)) != NULL) + { + /* If cell is in main database, check if there is a file path set. */ + if (dbdef->cd_file != NULL) + { + char *filepath, *sptr; + + filepath = StrDup((char **)NULL, dbdef->cd_file); + sptr = strrchr(filepath, '/'); + if (sptr) { + *sptr = '\0'; + inf = PaOpen(name, "r", ".res.ext", filepath, + EFLibPath, &efReadFileName); + } + freeMagic(filepath); + } + } + + /* Try with the standard search path */ + if ((inf == NULL) && (EFSearchPath == NULL)) + inf = PaOpen(name, "r", ".res.ext", Path, EFLibPath, &efReadFileName); + if (inf != NULL) goto readfile; } diff --git a/resis/ResRex.c b/resis/ResRex.c index 2b3a93b3..e2ad134c 100644 --- a/resis/ResRex.c +++ b/resis/ResRex.c @@ -975,7 +975,17 @@ ResCheckSimNodes(celldef, resisdata) if (ResOptionsFlags & ResOpt_DoExtFile) { - ResExtFile = PaOpen(outfile,"w",".res.ext",".",(char *) NULL, (char **) NULL); + if (ExtLocalPath != NULL) + if (strcmp(ExtLocalPath, ".")) + { + char *namebuf; + namebuf = mallocMagic(strlen(ExtLocalPath) + strlen(celldef->cd_name) + + 2); + sprintf(namebuf, "%s/%s", ExtLocalPath, celldef->cd_name); + outfile = namebuf; + } + ResExtFile = PaOpen(outfile, "w", ".res.ext", ".", (char *)NULL, (char **)NULL); + if (outfile != celldef->cd_name) freeMagic(outfile); } else {