From cc3a124120b3d8b88a5f79ce51d387667dfe71c4 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 25 Mar 2016 15:37:03 +0100 Subject: [PATCH] struct variable, #8/18, collect struct variable operations --- src/frontend/variable.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/variable.c b/src/frontend/variable.c index 232abe2a6..11e475cee 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -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