Fixed an error in variable.c that caused a segmentation fault and updated files for rework-13
This commit is contained in:
parent
385994e1e1
commit
a718fb27f5
|
|
@ -5,7 +5,7 @@ dnl Create a configuration header
|
|||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Initialize automake stuff
|
||||
AM_INIT_AUTOMAKE(ng-spice-rework,12)
|
||||
AM_INIT_AUTOMAKE(ng-spice-rework,13)
|
||||
|
||||
|
||||
dnl --enable-ansi : try to force --ansi option to the compiler
|
||||
|
|
|
|||
|
|
@ -89,13 +89,15 @@ cp_vset(char *varname, char type, char *value)
|
|||
int i;
|
||||
bool alreadythere = FALSE;
|
||||
char* copyvarname;
|
||||
/* varname = cp_unquote(varname); DG: Memory leak old varname is lost*/
|
||||
copyvarname= cp_unquote(varname);
|
||||
strcpy(varname,copyvarname);
|
||||
tfree(copyvarname);
|
||||
|
||||
|
||||
/* varname = cp_unquote(varname); DG: Memory leak old varname is lost*/
|
||||
|
||||
copyvarname = cp_unquote(varname);
|
||||
|
||||
w = NULL;
|
||||
for (v = variables; v; v = v->va_next) {
|
||||
if (eq(varname, v->va_name)) {
|
||||
if (eq(copyvarname, v->va_name)) {
|
||||
alreadythere = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -103,13 +105,13 @@ cp_vset(char *varname, char type, char *value)
|
|||
}
|
||||
if (!v) {
|
||||
v = alloc(struct variable);
|
||||
v->va_name = copy(varname);
|
||||
v->va_name = copy(copyvarname);
|
||||
v->va_next = NULL;
|
||||
}
|
||||
switch (type) {
|
||||
case VT_BOOL:
|
||||
if (* ((bool *) value) == FALSE) {
|
||||
cp_remvar(varname);
|
||||
cp_remvar(copyvarname);
|
||||
return;
|
||||
} else
|
||||
v->va_bool = TRUE;
|
||||
|
|
@ -143,21 +145,21 @@ cp_vset(char *varname, char type, char *value)
|
|||
* recognise these special variables: noglob, nonomatch, history,
|
||||
* echo, noclobber, prompt, and verbose. cp_remvar looks for these
|
||||
* variables too. The host program will get any others. */
|
||||
if (eq(varname, "noglob"))
|
||||
if (eq(copyvarname, "noglob"))
|
||||
cp_noglob = TRUE;
|
||||
else if (eq(varname, "nonomatch"))
|
||||
else if (eq(copyvarname, "nonomatch"))
|
||||
cp_nonomatch = TRUE;
|
||||
else if (eq(varname, "history") && (type == VT_NUM))
|
||||
else if (eq(copyvarname, "history") && (type == VT_NUM))
|
||||
cp_maxhistlength = v->va_num;
|
||||
else if (eq(varname, "history") && (type == VT_REAL))
|
||||
else if (eq(copyvarname, "history") && (type == VT_REAL))
|
||||
cp_maxhistlength = v->va_real;
|
||||
else if (eq(varname, "noclobber"))
|
||||
else if (eq(copyvarname, "noclobber"))
|
||||
cp_noclobber = TRUE;
|
||||
else if (eq(varname, "prompt") && (type == VT_STRING))
|
||||
else if (eq(copyvarname, "prompt") && (type == VT_STRING))
|
||||
cp_promptstring = copy(v->va_string);
|
||||
else if (eq(varname, "ignoreeof"))
|
||||
else if (eq(copyvarname, "ignoreeof"))
|
||||
cp_ignoreeof = TRUE;
|
||||
else if (eq(varname, "cpdebug")) {
|
||||
else if (eq(copyvarname, "cpdebug")) {
|
||||
cp_debug = TRUE;
|
||||
#ifndef CPDEBUG
|
||||
fprintf(cp_err,
|
||||
|
|
@ -202,7 +204,7 @@ cp_vset(char *varname, char type, char *value)
|
|||
alreadythere = FALSE;
|
||||
if (ft_curckt) {
|
||||
for (u = ft_curckt->ci_vars; u; u = u->va_next)
|
||||
if (eq(varname, u->va_name)) {
|
||||
if (eq(copyvarname, u->va_name)) {
|
||||
alreadythere = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -220,13 +222,14 @@ cp_vset(char *varname, char type, char *value)
|
|||
case US_NOSIMVAR:
|
||||
/* What do you do? */
|
||||
tfree(v);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(cp_err, "cp_vset: Internal Error: bad US val %d\n", i);
|
||||
break;
|
||||
}
|
||||
|
||||
tfree(copyvarname);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,17 +286,17 @@ Index time v(1)
|
|||
1 6.000000e-13 1.800000e-04
|
||||
2 7.422315e-13 2.226694e-04
|
||||
3 1.026694e-12 3.080083e-04
|
||||
4 1.595620e-12 4.786860e-04
|
||||
5 2.733472e-12 8.200415e-04
|
||||
6 5.009175e-12 1.502753e-03
|
||||
7 9.560581e-12 2.868174e-03
|
||||
8 1.866339e-11 5.599018e-03
|
||||
9 3.686902e-11 1.106071e-02
|
||||
10 7.328027e-11 2.198408e-02
|
||||
11 1.332803e-10 3.998408e-02
|
||||
12 1.932803e-10 5.798408e-02
|
||||
13 2.532803e-10 7.598408e-02
|
||||
14 3.132803e-10 9.398408e-02
|
||||
4 1.595620e-12 4.786861e-04
|
||||
5 2.733472e-12 8.200417e-04
|
||||
6 5.009176e-12 1.502753e-03
|
||||
7 9.560584e-12 2.868175e-03
|
||||
8 1.866340e-11 5.599020e-03
|
||||
9 3.686903e-11 1.106071e-02
|
||||
10 7.328029e-11 2.198409e-02
|
||||
11 1.332803e-10 3.998409e-02
|
||||
12 1.932803e-10 5.798409e-02
|
||||
13 2.532803e-10 7.598409e-02
|
||||
14 3.132803e-10 9.398409e-02
|
||||
15 3.732803e-10 1.119841e-01
|
||||
16 4.332803e-10 1.299841e-01
|
||||
17 4.932803e-10 1.479841e-01
|
||||
|
|
|
|||
Loading…
Reference in New Issue