X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=workspace.c;h=eca1bf2bb182178bba5cd3372a3e0dbc9e3f45cc;hb=f9ee932b62fcaa73bf092537ae212e6ab9cd7285;hp=26bbe8abcbcd70fb2f30d79a2e1f9d06249fbc85;hpb=c58ac3e241e0732e8513790c83eb1c1d42e97700;p=calc.git diff --git a/workspace.c b/workspace.c index 26bbe8a..eca1bf2 100644 --- a/workspace.c +++ b/workspace.c @@ -1,7 +1,6 @@ #include #include -#include "argument.h" #include "debug.h" #include "element.h" #include "parser.h" @@ -23,8 +22,13 @@ workspace_t *alloc_ws () workspace_t *backup_ws (workspace_t *ws) { ws->answer = answer; - ws->argument = copy_tab (argument); + if (ws->stack) { + free_tab (ws->stack); + } ws->stack = copy_tab (stack); + if (ws->storage) { + free_tab (ws->storage); + } ws->storage = copy_tab (storage); return ws; } @@ -35,11 +39,6 @@ workspace_t *clean_ws (workspace_t *ws) { ws->answer = 0; - if (ws->argument) { - free_tab (ws->argument); - ws->argument = NULL; - } - ws->id = 0; if (ws->root) { @@ -81,11 +80,6 @@ void restore_ws (workspace_t *ws) { answer = ws->answer; - if (argument) { - free_tab (argument); - } - argument = copy_tab (ws->argument); - if (stack) { free_tab (stack); }