summaryrefslogtreecommitdiffstats
path: root/generic/tclResult.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-02-05 21:35:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-02-05 21:35:10 (GMT)
commit2dad23ad65d5cf76fa7e2516a6702a8a6ff34723 (patch)
tree0b80be8eba412258b3fa4c109b6b554863d27378 /generic/tclResult.c
parenteee14742522aed25744851879c80a96134de7369 (diff)
downloadtcl-2dad23ad65d5cf76fa7e2516a6702a8a6ff34723.zip
tcl-2dad23ad65d5cf76fa7e2516a6702a8a6ff34723.tar.gz
tcl-2dad23ad65d5cf76fa7e2516a6702a8a6ff34723.tar.bz2
More size_t-related consolidations. Now regexp can handle strings >2GB and more. Remove many type-casts which are not necessary any more.
Diffstat (limited to 'generic/tclResult.c')
-rw-r--r--generic/tclResult.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclResult.c b/generic/tclResult.c
index a4df031..e7cc40f 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -383,12 +383,13 @@ Tcl_AppendElement(
Tcl_Obj *elementPtr = Tcl_NewStringObj(element, -1);
Tcl_Obj *listPtr = Tcl_NewListObj(1, &elementPtr);
const char *bytes;
+ size_t length;
if (Tcl_IsShared(iPtr->objResultPtr)) {
Tcl_SetObjResult(interp, Tcl_DuplicateObj(iPtr->objResultPtr));
}
- bytes = TclGetString(iPtr->objResultPtr);
- if (TclNeedSpace(bytes, bytes+iPtr->objResultPtr->length)) {
+ bytes = TclGetStringFromObj(iPtr->objResultPtr, &length);
+ if (TclNeedSpace(bytes, bytes + length)) {
Tcl_AppendToObj(iPtr->objResultPtr, " ", 1);
}
Tcl_AppendObjToObj(iPtr->objResultPtr, listPtr);
@@ -778,8 +779,10 @@ TclProcessReturn(
Tcl_DictObjGet(NULL, iPtr->returnOpts, keys[KEY_ERRORINFO],
&valuePtr);
if (valuePtr != NULL) {
- (void) TclGetString(valuePtr);
- if (valuePtr->length) {
+ size_t length;
+
+ (void) TclGetStringFromObj(valuePtr, &length);
+ if (length) {
iPtr->errorInfo = valuePtr;
Tcl_IncrRefCount(iPtr->errorInfo);
iPtr->flags |= ERR_ALREADY_LOGGED;