X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=blobdiff_plain;f=base%2Fhook.c;h=cdcb246d2c742b945ad8444faad1cd1705529b01;hp=f364978c200db68dde9b2ba53c0a3e8faa898533;hb=5d466de467f28ae6f7125bef086d141a7734a4ce;hpb=29d695bbfb0f42019af456fc8a7a3137e9745806 diff --git a/base/hook.c b/base/hook.c index f364978..cdcb246 100644 --- a/base/hook.c +++ b/base/hook.c @@ -61,10 +61,10 @@ int do_hbytes_rep_info(ClientData cd, Tcl_Interp *ip, } static void hbytes_t_dup(Tcl_Obj *src, Tcl_Obj *dup) { - objfreeir(dup); hbytes_array(OBJ_HBYTES(dup), hbytes_data(OBJ_HBYTES(src)), hbytes_len(OBJ_HBYTES(src))); + dup->typePtr= &hbytes_type; } static void hbytes_t_free(Tcl_Obj *o) { @@ -210,6 +210,18 @@ int do_hbytes_overwrite(ClientData cd, Tcl_Interp *ip, return TCL_OK; } +int do_hbytes_trimleft(ClientData cd, Tcl_Interp *ip, HBytes_Var v) { + const Byte *o, *p, *e; + o= p= hbytes_data(v.hb); + e= p + hbytes_len(v.hb); + + while (p