diff options
author | dgp <dgp@users.sourceforge.net> | 2006-02-09 17:34:41 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-02-09 17:34:41 (GMT) |
commit | 3e2f142b59552edeaa2a6bb5e4a5d31e076ae8d7 (patch) | |
tree | 19ebc4b4f4d8e5362c861dd8242031f5c8e16600 /generic | |
parent | af5c89aba29208e6298cd59900eb13feaac963c8 (diff) | |
download | tcl-3e2f142b59552edeaa2a6bb5e4a5d31e076ae8d7.zip tcl-3e2f142b59552edeaa2a6bb5e4a5d31e076ae8d7.tar.gz tcl-3e2f142b59552edeaa2a6bb5e4a5d31e076ae8d7.tar.bz2 |
TIP#215 IMPLEMENTATION
* doc/incr.n: Revised [incr] to auto-initialize when varName
* generic/tclExecute.c: argument is unset. [Patch 1413115].
* generic/tclVar.c:
* tests/compile.test:
* tests/incr-old.test:
* tests/incr.test:
* tests/set.test:
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 4 | ||||
-rw-r--r-- | generic/tclVar.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 6fb49ec..6777cd2 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.225 2005/12/27 20:14:08 kennykb Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.226 2006/02/09 17:34:41 dgp Exp $ */ #include "tclInt.h" @@ -2403,7 +2403,7 @@ TclExecuteByteCode( part1 = TclGetString(objPtr); varPtr = TclObjLookupVar(interp, objPtr, part2, - TCL_LEAVE_ERR_MSG, "read", 0, 1, &arrayPtr); + TCL_LEAVE_ERR_MSG, "read", 1, 1, &arrayPtr); if (varPtr == NULL) { Tcl_AddObjErrorInfo(interp, "\n (reading value of variable to increment)", -1); diff --git a/generic/tclVar.c b/generic/tclVar.c index 0977bfc..50b02b3 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.119 2006/02/02 10:55:05 dkf Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.120 2006/02/09 17:34:42 dgp Exp $ */ #include "tclInt.h" @@ -1780,7 +1780,7 @@ TclIncrObjVar2( part2 = ((part2Ptr == NULL)? NULL : TclGetString(part2Ptr)); varPtr = TclObjLookupVar(interp, part1Ptr, part2, flags, "read", - 0, 1, &arrayPtr); + 1, 1, &arrayPtr); if (varPtr == NULL) { Tcl_AddObjErrorInfo(interp, "\n (reading value of variable to increment)", -1); @@ -1839,11 +1839,11 @@ TclPtrIncrObjVar( register Tcl_Obj *varValuePtr, *newValuePtr = NULL; int duplicated, code; + varPtr->refCount++; varValuePtr = TclPtrGetVar(interp, varPtr, arrayPtr, part1, part2, flags); + varPtr->refCount--; if (varValuePtr == NULL) { - Tcl_AddObjErrorInfo(interp, - "\n (reading value of variable to increment)", -1); - return NULL; + varValuePtr = Tcl_NewIntObj(0); } if (Tcl_IsShared(varValuePtr)) { duplicated = 1; |