struct variable, #8/18, collect struct variable operations

This commit is contained in:
rlar 2016-03-25 15:37:03 +01:00
parent 41b5f17906
commit cc3a124120
1 changed files with 5 additions and 2 deletions

View File

@ -121,23 +121,28 @@ cp_vset(char *varname, enum cp_types type, void *value)
tfree(copyvarname);
return;
} else {
v->va_type = CP_BOOL;
v->va_bool = TRUE;
}
break;
case CP_NUM:
v->va_type = CP_NUM;
v->va_num = * (int *) value;
break;
case CP_REAL:
v->va_type = CP_REAL;
v->va_real = * (double *) value;
break;
case CP_STRING:
v->va_type = CP_STRING;
v->va_string = copy((char*) value);
break;
case CP_LIST:
v->va_type = CP_LIST;
v->va_vlist = (struct variable *) value;
break;
@ -149,8 +154,6 @@ cp_vset(char *varname, enum cp_types type, void *value)
return;
}
v->va_type = type;
/* Now, see if there is anything interesting going on. We
* recognise these special variables: noglob, nonomatch, history,
* echo, noclobber, prompt, and verbose. cp_remvar looks for these