chiark / gitweb /
Invalidate string rep. Before make expandable buffer.
[chiark-tcl.git] / hbytes / chop.c
index 5d89cd22c0f44969a3a043f9a8014f3e18be8784..49995339b2fdcf43d5919054d5b49904b2152d33 100644 (file)
@@ -13,6 +13,8 @@ static int strs(Tcl_Interp *ip, int strc, Tcl_Obj *const *strv, int *l_r) {
     rc= Tcl_ConvertToType(ip,strv[i],&hbytes_type);
     if (rc) return rc;
     l += HBYTES_LEN(HBYTES(strv[i]));
+fprintf(stderr,"strs #%d %d %02x\n",i,l,
+       HBYTES(strv[i]).start ? HBYTES(strv[i]).start[0] : 0xff);
   }
   *l_r= l;
   return TCL_OK;
@@ -40,12 +42,12 @@ int app_pre(ClientData cd, Tcl_Interp *ip, int begin,
 
 int do_hbytes_append(ClientData cd, Tcl_Interp *ip,
                     HBytes_Var v, int strc, Tcl_Obj *const *strv) {
-  return app_pre(cd,ip,1,v,strc,strv);
+  return app_pre(cd,ip,0,v,strc,strv);
 }
   
 int do_hbytes_prepend(ClientData cd, Tcl_Interp *ip,
                      HBytes_Var v, int strc, Tcl_Obj *const *strv) {
-  return app_pre(cd,ip,0,v,strc,strv);
+  return app_pre(cd,ip,1,v,strc,strv);
 }
 
 int do_hbytes_concat(ClientData cd, Tcl_Interp *ip,