/[cvs]/stack/symbols.c
ViewVC logotype

Diff of /stack/symbols.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by masse, Mon Aug 4 14:13:16 2003 UTC revision 1.3 by masse, Mon Aug 4 14:32:27 2003 UTC
# Line 1  Line 1 
 #include <stdio.h>  
1  #include "stack.h"  #include "stack.h"
2    
3  /* Print newline. */  /* Print newline. */
# Line 294  extern void def(environment *env) Line 293  extern void def(environment *env)
293    }    }
294    
295    /* long names are a pain */    /* long names are a pain */
296    sym= CAR(env->head)->content.ptr;    sym= CAR(env->head)->content.sym;
297    
298    /* Bind the symbol to the value */    /* Bind the symbol to the value */
299    sym->val= CAR(CDR(env->head));    sym->val= CAR(CDR(env->head));
# Line 360  extern void sx_2b(environment *env) Line 359  extern void sx_2b(environment *env)
359      protect(a_val); protect(b_val);      protect(a_val); protect(b_val);
360      toss(env); if(env->err) return;      toss(env); if(env->err) return;
361      toss(env); if(env->err) return;      toss(env); if(env->err) return;
362      len= strlen(a_val->content.ptr)+strlen(b_val->content.ptr)+1;      len= strlen(a_val->content.string)+strlen(b_val->content.string)+1;
363      new_string= malloc(len);      new_string= malloc(len);
364      assert(new_string != NULL);      assert(new_string != NULL);
365      strcpy(new_string, b_val->content.ptr);      strcpy(new_string, b_val->content.string);
366      strcat(new_string, a_val->content.ptr);      strcat(new_string, a_val->content.string);
367      push_cstring(env, new_string);      push_cstring(env, new_string);
368      unprotect(a_val); unprotect(b_val);      unprotect(a_val); unprotect(b_val);
369      free(new_string);      free(new_string);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

root@recompile.se
ViewVC Help
Powered by ViewVC 1.1.26