chiark
/
gitweb
/
~ian
/
chiark-tcl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
503f816
)
Invalidate string rep. Before make expandable buffer.
author
ian
<ian>
Sun, 1 Sep 2002 18:12:05 +0000
(18:12 +0000)
committer
ian
<ian>
Sun, 1 Sep 2002 18:12:05 +0000
(18:12 +0000)
base/parse.c
patch
|
blob
|
history
hbytes/chop.c
patch
|
blob
|
history
hbytes/parse.c
patch
|
blob
|
history
diff --git
a/base/parse.c
b/base/parse.c
index a7ac819c637813e78caef4991c3c46f32e2ebdf0..1e1e5bb2ba616b13d3a27e08e8a9c74d1458c8c6 100644
(file)
--- a/
base/parse.c
+++ b/
base/parse.c
@@
-49,6
+49,7
@@
int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) {
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
Tcl_Obj *ro;
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
Tcl_Obj *ro;
+ Tcl_InvalidateStringRep(agg->obj);
if (!rc) {
assert(agg->obj);
ro= Tcl_ObjSetVar2(ip,agg->var,0,agg->obj,TCL_LEAVE_ERR_MSG);
if (!rc) {
assert(agg->obj);
ro= Tcl_ObjSetVar2(ip,agg->var,0,agg->obj,TCL_LEAVE_ERR_MSG);
diff --git
a/hbytes/chop.c
b/hbytes/chop.c
index 5d89cd22c0f44969a3a043f9a8014f3e18be8784..49995339b2fdcf43d5919054d5b49904b2152d33 100644
(file)
--- a/
hbytes/chop.c
+++ b/
hbytes/chop.c
@@
-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]));
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;
}
*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) {
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) {
}
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,
}
int do_hbytes_concat(ClientData cd, Tcl_Interp *ip,
diff --git
a/hbytes/parse.c
b/hbytes/parse.c
index a7ac819c637813e78caef4991c3c46f32e2ebdf0..1e1e5bb2ba616b13d3a27e08e8a9c74d1458c8c6 100644
(file)
--- a/
hbytes/parse.c
+++ b/
hbytes/parse.c
@@
-49,6
+49,7
@@
int pat_hbv(Tcl_Interp *ip, Tcl_Obj *var, HBytes_Var *agg) {
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
Tcl_Obj *ro;
void fini_hbv(Tcl_Interp *ip, int rc, HBytes_Var *agg) {
Tcl_Obj *ro;
+ Tcl_InvalidateStringRep(agg->obj);
if (!rc) {
assert(agg->obj);
ro= Tcl_ObjSetVar2(ip,agg->var,0,agg->obj,TCL_LEAVE_ERR_MSG);
if (!rc) {
assert(agg->obj);
ro= Tcl_ObjSetVar2(ip,agg->var,0,agg->obj,TCL_LEAVE_ERR_MSG);