fix correct version syntax when saving in file

This commit is contained in:
Stefan Frederik 2020-12-17 02:01:38 +01:00
parent a438d436bf
commit c13ca9218d
5 changed files with 14 additions and 8 deletions

View File

@ -291,7 +291,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
if(rot == 3 && flip == 1 ) { x=textx1;}
}
llength=0;
my_strdup2(465, &sss, str);
my_strdup2(54, &sss, str);
tt=ss=sss;
for(;;) {
c=*ss;
@ -308,7 +308,7 @@ static void ps_draw_string(int layer, const char *str, short rot, short flip, in
}
ss++;
}
my_free(1154, &sss);
my_free(53, &sss);
}
static void old_ps_draw_string(int gctext, const char *str,

View File

@ -400,10 +400,16 @@ void save_line(FILE *fd)
void write_xschem_file(FILE *fd)
{
int ty=0;
char *ptr;
my_strdup2(1183, &xctx->version_string, subst_token(xctx->version_string, "version", XSCHEM_VERSION));
my_strdup2(1184, &xctx->version_string, subst_token(xctx->version_string, "file_version", XSCHEM_FILE_VERSION));
fprintf(fd, "v {%s}\n", xctx->version_string);
if( (ptr = strstr(xctx->version_string, "xschem")) && (ptr - xctx->version_string < 50) ) {
my_strdup2(59, &xctx->version_string, subst_token(xctx->version_string, "xschem", NULL));
}
my_strdup2(1183, &xctx->version_string, subst_token(xctx->version_string, "version", NULL));
my_strdup2(1184, &xctx->version_string, subst_token(xctx->version_string, "file_version", NULL));
ptr = xctx->version_string;
while(*ptr == ' ' || *ptr == '\t') ptr++; /* strip leading spaces */
fprintf(fd, "v {xschem version=%s file_version=%s %s}\n", XSCHEM_VERSION, XSCHEM_FILE_VERSION, ptr);
if(xctx->schvhdlprop && !xctx->schsymbolprop) {

View File

@ -1,4 +1,4 @@
v {xschem version=2.9.8 file_version=1.2}
v {xschem version=2.9.8 file_version=1.2 }
G {}
K {}
V {}

View File

@ -1,4 +1,4 @@
v { version=2.9.8 file_version=1.2}
v {xschem version=2.9.8 file_version=1.2 }
G {}
K {}
V {}

View File

@ -1,4 +1,4 @@
v { version=2.9.8 file_version=1.2}
v {xschem version=2.9.8 file_version=1.2 }
G {}
K {}
V {}