--- stack/stack.c 2002/03/17 00:55:58 1.113 +++ stack/stack.c 2002/03/17 02:15:01 1.114 @@ -233,7 +233,7 @@ /* Keep values */ env->gc_count += sizeof(value); if(env->gc_ref->item->type==string) - env->gc_count += strlen(env->gc_ref->item->content.ptr); + env->gc_count += strlen(env->gc_ref->item->content.ptr)+1; titem= env->gc_ref->next; env->gc_ref->next= new_head; @@ -484,7 +484,7 @@ toss(env); } -/* Prints the top element of the stack. */ +/* Print a value */ void print_val(value *val, int noquote) { switch(val->type) { @@ -513,7 +513,8 @@ printf("[ "); do { print_val(CAR(val), noquote); - switch(CDR(val)->type){ + val= CDR(val); + switch(val->type){ case empty: break; case tcons: @@ -521,9 +522,8 @@ break; default: printf(" . "); /* Improper list */ - print_val(CDR(val), noquote); + print_val(val, noquote); } - val= CDR(val); } while(val->type == tcons); printf(" ]"); break; @@ -1049,7 +1049,7 @@ } if(myenv.interactive) { - printf("Stack version $Revision: 1.113 $\n\ + printf("Stack version $Revision: 1.114 $\n\ Copyright (C) 2002 Mats Alritzson and Teddy Hogeborn\n\ Stack comes with ABSOLUTELY NO WARRANTY; for details type 'warranty;'.\n\ This is free software, and you are welcome to redistribute it\n\ @@ -1725,6 +1725,9 @@ } else { push_float(env, ftemp); } + } else if(sscanf(env->in_string, "\"\"%n", &readlength) != EOF + && readlength != -1) { + push_cstring(env, ""); } else if(sscanf(env->in_string, strform, match, &readlength) != EOF && readlength != -1) { push_cstring(env, match);