--- stack/stack.c 2002/01/08 18:06:19 1.11 +++ stack/stack.c 2002/01/09 05:01:24 1.13 @@ -242,7 +242,9 @@ push_cstring(stack_head, temp); else if((convert= sscanf(in_line, "%d %[^\n\r]", &itemp, rest)) >= 1) push_val(stack_head, itemp); - else if((convert= sscanf(in_line, "%[^ ;\n\r]%[^\n\r]", temp, rest)) >= 1) + else if((convert= sscanf(in_line, "\\%c%[^\n\r]", temp, rest)) >= 1) { + temp[1]= '\0'; push_ref(stack_head, in_hash, temp); + } else if((convert= sscanf(in_line, "%[^ ;\n\r]%[^\n\r]", temp, rest)) >= 1) push_ref(stack_head, in_hash, temp); else if((convert= sscanf(in_line, "%c%[^\n\r]", temp, rest)) >= 1) if(*temp==';') @@ -329,7 +331,8 @@ return; left= (*stack_head)->content.ptr; - right= (*stack_head)->next->content.ptr; + swap(stack_head); + right= (*stack_head)->content.ptr; result= (left==right); toss(stack_head); toss(stack_head); @@ -354,6 +357,23 @@ not(stack_head); } +extern void def(stackitem** stack_head) +{ + stackitem *temp, *value; + + if(*stack_head==NULL || (*stack_head)->next==NULL + || (*stack_head)->type!=ref) + return; + + temp= (*stack_head)->content.ptr; + value= (*stack_head)->next; + temp->content= value->content; + value->content.ptr=NULL; + temp->type= value->type; + + toss(stack_head); toss(stack_head); +} + extern void quit() { exit(EXIT_SUCCESS);