Browse Source

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

pre-master-46
rlar 10 years ago
parent
commit
cc3a124120
  1. 7
      src/frontend/variable.c

7
src/frontend/variable.c

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

Loading…
Cancel
Save