From 280580cb36c9db1ad7b9631ec2b2dd8eae359b20 Mon Sep 17 00:00:00 2001 From: dwarning Date: Wed, 2 Jan 2008 18:24:56 +0000 Subject: [PATCH] fix the wrong rawfile writing for v(#) --- src/frontend/outitf.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index e85053c8b..707604291 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -26,9 +26,8 @@ $Id$ #include "outitf.h" #include "variable.h" #include -#include #include "cktdefs.h" -#include +#include "inpdefs.h" #include "breakp2.h" #include "runcoms.h" #include "plotting/graf.h" @@ -738,16 +737,12 @@ static void fileInit_pass2(runDesc *run) { int i, type; - char *name, buf[BSIZE_SP], *branch; + char *name, *branch; for (i = 0; i < run->numData; i++) { - - if (isdigit(*run->data[i].name)) { - (void) sprintf(buf, "v(%s)", run->data[i].name); - name = buf; - } else { - name = run->data[i].name; - } + + name = run->data[i].name; + if (substring("#branch", name)) type = SV_CURRENT; else if (cieq(name, "time")) @@ -761,18 +756,18 @@ fileInit_pass2(runDesc *run) else type = SV_VOLTAGE; - if ( type == SV_CURRENT ) { - branch = NULL; - if ( (branch = strstr( name, "#branch" )) ) { - *branch = '\0'; - } - fprintf(run->fp, "\t%d\ti(%s)\t%s", i, name, ft_typenames(type)); - if ( branch != NULL ) *branch = '#'; - } else if ( type == SV_VOLTAGE ) { - fprintf(run->fp, "\t%d\tv(%s)\t%s", i, name, ft_typenames(type)); - } else { - fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type)); - } + if ( type == SV_CURRENT ) { + branch = NULL; + if ( (branch = strstr( name, "#branch" )) ) { + *branch = '\0'; + } + fprintf(run->fp, "\t%d\ti(%s)\t%s", i, name, ft_typenames(type)); + if ( branch != NULL ) *branch = '#'; + } else if ( type == SV_VOLTAGE ) { + fprintf(run->fp, "\t%d\tv(%s)\t%s", i, name, ft_typenames(type)); + } else { + fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type)); + } if (run->data[i].gtype == GRID_XLOG) fprintf(run->fp, "\tgrid=3"); fprintf(run->fp, "\n");