mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-09-03 04:33:55 +02:00
Corrected two potentially fatal errors: (1) Code doing the PDK_PATH
and HOME substitution in filenames needs to watch for a NULL cd_file, and (2) The routine that removes the (UNNAMED) cell when another cell is loaded needs to NULL the boxRootDef pointer or else it ends up pointing to deallocated memory.
This commit is contained in:
@@ -273,6 +273,7 @@ DBCellDelete(cellname, force)
|
||||
}
|
||||
celldef->cd_parents = (CellUse *)NULL;
|
||||
|
||||
DBWResetBox(celldef);
|
||||
result = DBCellDeleteDef(celldef);
|
||||
|
||||
if (result == FALSE)
|
||||
@@ -282,8 +283,6 @@ DBCellDelete(cellname, force)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------
|
||||
*
|
||||
|
||||
+3
-1
@@ -3494,7 +3494,9 @@ DBPathSubstitute(pathstart, cstring, cellDef)
|
||||
|
||||
char *homedir = getenv("HOME");
|
||||
|
||||
if (!strncmp(cellDef->cd_file, homedir, strlen(homedir))
|
||||
if (cellDef->cd_file == NULL)
|
||||
sprintf(cstring, "%s", pathstart);
|
||||
else if (!strncmp(cellDef->cd_file, homedir, strlen(homedir))
|
||||
&& (*(cellDef->cd_file + strlen(homedir)) == '/'))
|
||||
sprintf(cstring, "~%s", cellDef->cd_file + strlen(homedir));
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user