diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-19 13:21:56 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-19 13:21:56 (GMT) |
| commit | 11b8f6eb00bb80ed84c0b8f4c382b9626f94e7ea (patch) | |
| tree | fb7f2d96d4fe7aaed651b4d6145ad93a333803ea /generic | |
| parent | f6830a72ec9060084f21dea70771bc1092d5f207 (diff) | |
| download | tcl-11b8f6eb00bb80ed84c0b8f4c382b9626f94e7ea.zip tcl-11b8f6eb00bb80ed84c0b8f4c382b9626f94e7ea.tar.gz tcl-11b8f6eb00bb80ed84c0b8f4c382b9626f94e7ea.tar.bz2 | |
Fix [3c04fcdd1a] - join truncates large lists
Diffstat (limited to 'generic')
| -rw-r--r-- | generic/tclInt.h | 2 | ||||
| -rw-r--r-- | generic/tclStringObj.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index d602afd..7efc0a7 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4033,7 +4033,7 @@ MODULE_SCOPE int TclCompileAssembleCmd(Tcl_Interp *interp, * candidates for public interface. */ -MODULE_SCOPE Tcl_Obj * TclStringCat(Tcl_Interp *interp, int objc, +MODULE_SCOPE Tcl_Obj * TclStringCat(Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int flags); MODULE_SCOPE Tcl_Obj * TclStringFirst(Tcl_Obj *needle, Tcl_Obj *haystack, Tcl_Size start); diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 3063ea3..2bbc4bc 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -3115,23 +3115,24 @@ TclStringRepeat( Tcl_Obj * TclStringCat( Tcl_Interp *interp, - int objc, + Tcl_Size objc, Tcl_Obj * const objv[], int flags) { Tcl_Obj *objResultPtr, * const *ov; - int oc, binary = 1; + int binary = 1; + Tcl_Size oc; Tcl_Size length = 0; int allowUniChar = 1, requestUniChar = 0, forceUniChar = 0; - int first = objc - 1; /* Index of first value possibly not empty */ - int last = 0; /* Index of last value possibly not empty */ + Tcl_Size first = objc - 1; /* Index of first value possibly not empty */ + Tcl_Size last = 0; /* Index of last value possibly not empty */ int inPlace = flags & TCL_STRING_IN_PLACE; /* assert ( objc >= 0 ) */ if (objc <= 1) { - /* Only one or no objects; return first or empty */ - return objc ? objv[0] : Tcl_NewObj(); + /* Negative (shouldn't be), one or no objects; return first or empty */ + return objc == 1 ? objv[0] : Tcl_NewObj(); } /* assert ( objc >= 2 ) */ |
