From e991e2cfc7e6f4ab6c608d79a88a80367b588214 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 16 Apr 2018 21:43:35 -0400 Subject: [PATCH] Added a fallback method to file reading so as to not create havoc from the rigorous method of versioning in case files are relocated and the use paths are no longer valid. Cells are then searched for in the search paths in the traditional manner, albeit with a stern warning. This should avoid most backwards-compatbility issues. --- database/DBio.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/database/DBio.c b/database/DBio.c index 5e9f1786..704b3ee4 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -1025,6 +1025,24 @@ dbReadOpen(cellDef, name, setFileName, errptr) f = PaLockOpen(cellDef->cd_file, "r", DBSuffix, ".", (char *) NULL, &filename, &is_locked); + /* Fall back on the original method of using search paths. */ + + if (f == NULL) + { + f = PaLockOpen(cellDef->cd_name, "r", DBSuffix, Path, + CellLibPath, &filename, &is_locked); + + if (f != NULL) + { + TxError("Warning: Parent cell of %s marked file location as %s.\n", + cellDef->cd_name, cellDef->cd_file); + TxError("Cell could not be found in that location. However," + " the cell was found in\n"); + TxError("the search paths at %s.\n", filename); + TxError("Please make sure that this is the intended cell version.\n"); + } + } + if (errptr != NULL) *errptr = errno; if (pptr != NULL) *pptr = '.'; // Put it back where you found it! }