Merge branch 'master' into bplane

Conflicts:
	VERSION
	tcltk/ext2sim.sh
	tcltk/ext2spice.sh

Merged corrections to "save"/"writeall" from master branch
This commit is contained in:
Tim Edwards 2020-03-23 11:04:50 -04:00
commit 33a40d1986
5 changed files with 24 additions and 52 deletions

2
.gitignore vendored
View File

@ -25,3 +25,5 @@ tcltk/magic.sh
tcltk/magic.tcl
tcltk/magicdnull
tcltk/magicexec
tcltk/ext2spice.sh
tcltk/ext2sim.sh

View File

@ -2709,7 +2709,7 @@ DBCellWrite(cellDef, fileName)
#define NAME_SIZE 1000
char *template = ".XXXXXXX";
char *realname, *tmpname, *expandname;
char *cp1, *cp2;
char *cp1, *cp2, *dotptr;
char expandbuf[NAME_SIZE];
FILE *realf, *tmpf;
int tmpres;
@ -2738,8 +2738,16 @@ DBCellWrite(cellDef, fileName)
cellDef->cd_file = StrDup(&cellDef->cd_file, fileName);
realname = (char *) mallocMagic(strlen(fileName) + strlen(DBSuffix) + 1);
(void) sprintf(realname, "%s%s", fileName, DBSuffix);
/* The cd_file should not have the .mag suffix, but make sure */
/* it doesn't before adding one. */
if (strcmp(fileName + strlen(fileName) - 4, DBSuffix))
{
realname = (char *) mallocMagic(strlen(fileName) + strlen(DBSuffix) + 1);
(void) sprintf(realname, "%s%s", fileName, DBSuffix);
}
else
realname = StrDup((char **)NULL, fileName);
/*
* Expand the filename, removing the leading ~, if any.
@ -2927,13 +2935,21 @@ DBCellWrite(cellDef, fileName)
}
}
/* Copy expandname back to cellDef->cd_file, if the name was changed. */
/* The file extension does not get copied into cd_file. */
dotptr = strrchr(expandname, '.');
if (dotptr) *dotptr = '\0';
if (strcmp(expandname, cellDef->cd_file))
StrDup(&cellDef->cd_file, expandname);
if (dotptr) *dotptr = '.';
/* Everything worked so far. */
(void) StrDup(&cellDef->cd_file, expandname);
result = TRUE;
{
struct stat thestat;
realf = fopen(expandname,"r");
realf = fopen(expandname, "r");
if (realf == NULL)
{
cellDef->cd_flags |= CDMODIFIED;

View File

@ -9,7 +9,7 @@ SRCS = tclmagic.c
include ${MAGICDIR}/defs.mak
DFLAGS += -DMAGIC_DATE="\"`date`\""
CLEANS += magic.sh magic.tcl magicexec magicdnull
CLEANS += magic.sh magic.tcl magicexec magicdnull ext2spice.sh ext2sim.sh
TCL_FILES = \
tkcon.tcl \

View File

@ -1,23 +0,0 @@
#!/bin/sh
#
# Standalone script for ext2sim, for Tcl-based magic 8.0
#
# Parse arguments. "--" separates arguments to magic
# from arguments to ext2sim.
#
mgargs=""
esargs=""
for i in $@; do
case $i in
--) mgargs="$esargs"
esargs="" ;;
*) esargs="$esargs $i" ;;
esac
done
#
eval /home/tim/cad/lib/magic/tcl/magicdnull -dnull -noconsole -nowrapper $mgargs <<EOF
drc off
box 0 0 0 0
ext2sim $esargs
quit -noprompt
EOF

View File

@ -1,23 +0,0 @@
#!/bin/sh
#
# Standalone script for ext2spice, for Tcl-based magic 8.0
#
# Parse arguments. "--" separates arguments to magic
# from arguments to ext2spice.
#
mgargs=""
esargs=""
for i in $@; do
case $i in
--) mgargs="$esargs"
esargs="" ;;
*) esargs="$esargs $i" ;;
esac
done
#
eval /home/tim/cad/lib/magic/tcl/magicdnull -dnull -noconsole -nowrapper $mgargs <<EOF
drc off
box 0 0 0 0
ext2spice $esargs
quit -noprompt
EOF