Revised the file opening routine with respect to the search paths.

Previously, a file path beginning with "/", "./", or "../" would be
searched for verbatim and no searching would be done over paths.
This behavior now occurs for a leading "/" only.  File paths with
"./" or "../" will search for the file with the path verbatim, then
proceed to search for the file with each search path prepended to
the filename as usual.  This solves a problem for reusable, non- PDK
IP blocks, where the IP block may have an abstract view pointing to
a GDS file which is specified as being located at "../gds/<file>".
This file would not be found if the IP block was included into
another project.  Now it can be done if the path to the IP is given
by "addpath".
This commit is contained in:
Tim Edwards 2024-08-16 17:45:10 -04:00
parent f3bfde60f0
commit 0c36365db8
2 changed files with 11 additions and 4 deletions

View File

@ -1 +1 @@
8.3.488
8.3.489

View File

@ -736,8 +736,9 @@ PaLockOpen(file, mode, ext, path, library, pRealName, is_locked, fdp)
#endif
f = fopen(realName, mode);
if ((fdp != NULL) && (f != NULL)) *fdp = fileno(f);
return f;
if ((fdp != NULL) && (f != NULL)) *fdp = fileno(f);
if ((f != NULL) || (file[0] == '/'))
return f;
}
/* Now try going through the path, one entry at a time. */
@ -883,9 +884,15 @@ PaZOpen(file, mode, ext, path, library, pRealName)
|| strcmp(file, "..") == 0
|| strncmp(file, "../", 3) == 0)))
{
gzFile result;
(void) strncpy(realName, file, MAXSIZE-1);
realName[MAXSIZE-1] = '\0';
return gzopen(realName, mode);
/* For full paths, halt immediately if not found. Otherwise,
* treat the path as relative to something in the search path.
*/
result = gzopen(realName, mode);
if ((result != NULL) || (file[0] == '/')) return result;
}
/* Now try going through the path, one entry at a time. */