One correction to the last commit, otherwise segfaults are
essentially guaranteed. . .
This commit is contained in:
parent
82fada3af6
commit
8d8fe2fe55
|
|
@ -4261,6 +4261,11 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
|
||||||
cellnameptr++;
|
cellnameptr++;
|
||||||
fullpathname = (char *)mallocMagic(strlen(cmd->tx_argv[1]) + 2);
|
fullpathname = (char *)mallocMagic(strlen(cmd->tx_argv[1]) + 2);
|
||||||
strcpy(fullpathname, cmd->tx_argv[1]);
|
strcpy(fullpathname, cmd->tx_argv[1]);
|
||||||
|
|
||||||
|
/* If the name still has ".mag" attached, then strip it. */
|
||||||
|
clen = strlen(fullpathname);
|
||||||
|
if ((clen > 4) && !strcmp(fullpathname + clen - 4, ".mag"))
|
||||||
|
*(fullpathname + clen - 4) = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -4273,11 +4278,6 @@ cmdDumpParseArgs(cmdName, w, cmd, dummy, scx)
|
||||||
if ((clen > 4) && !strcmp(cellnameptr + clen - 4, ".mag"))
|
if ((clen > 4) && !strcmp(cellnameptr + clen - 4, ".mag"))
|
||||||
*(cellnameptr + clen - 4) = '\0';
|
*(cellnameptr + clen - 4) = '\0';
|
||||||
|
|
||||||
/* Same for fullpathname */
|
|
||||||
clen = strlen(fullpathname);
|
|
||||||
if ((clen > 4) && !strcmp(fullpathname + clen - 4, ".mag"))
|
|
||||||
*(fullpathname + clen - 4) = '\0';
|
|
||||||
|
|
||||||
/* Check for illegal characters in the cellname */
|
/* Check for illegal characters in the cellname */
|
||||||
if (CmdIllegalChars(cellnameptr, "", "Cell name"))
|
if (CmdIllegalChars(cellnameptr, "", "Cell name"))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue