summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/variable.n7
-rw-r--r--generic/tclCmdIL.c46
-rw-r--r--generic/tclCmdMZ.c18
-rw-r--r--generic/tclDictObj.c45
-rw-r--r--generic/tclExecute.c146
-rw-r--r--generic/tclInt.h3
-rw-r--r--generic/tclStringObj.c240
-rw-r--r--generic/tclZlib.c151
-rw-r--r--library/history.tcl24
-rw-r--r--library/tzdata/Asia/Colombo14
-rw-r--r--library/tzdata/Asia/Gaza168
-rw-r--r--library/tzdata/Asia/Hebron168
-rw-r--r--library/tzdata/Europe/Istanbul22
-rw-r--r--tests/binary.test13
-rw-r--r--tests/history.test58
-rw-r--r--tests/zlib.test19
16 files changed, 722 insertions, 420 deletions
diff --git a/doc/variable.n b/doc/variable.n
index a6e545f..8228859 100644
--- a/doc/variable.n
+++ b/doc/variable.n
@@ -45,7 +45,8 @@ linked to the corresponding namespace variables (and therefore these
variables are listed by \fBinfo vars\fR.)
In this way the \fBvariable\fR command resembles the \fBglobal\fR command,
although the \fBglobal\fR command
-only links to variables in the global namespace.
+resolves variable names with respect to the global namespace instead
+of the current namespace of the procedure.
If any \fIvalue\fRs are given,
they are used to modify the values of the associated namespace variables.
If a namespace variable does not exist,
@@ -98,3 +99,7 @@ namespace eval foo {
global(n), namespace(n), upvar(n)
.SH KEYWORDS
global, namespace, procedure, variable
+.\" Local variables:
+.\" mode: nroff
+.\" fill-column: 78
+.\" End:
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index df1d33c..9058d0f 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -2145,8 +2145,8 @@ Tcl_JoinObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* The argument objects. */
{
- int listLen, i;
- Tcl_Obj *resObjPtr, *joinObjPtr, **elemPtrs;
+ int listLen;
+ Tcl_Obj *resObjPtr = NULL, *joinObjPtr, **elemPtrs;
if ((objc < 2) || (objc > 3)) {
Tcl_WrongNumArgs(interp, 1, objv, "list ?joinString?");
@@ -2163,19 +2163,47 @@ Tcl_JoinObjCmd(
return TCL_ERROR;
}
+ if (listLen == 0) {
+ /* No elements to join; default empty result is correct. */
+ return TCL_OK;
+ }
+ if (listLen == 1) {
+ /* One element; return it */
+ Tcl_SetObjResult(interp, elemPtrs[0]);
+ return TCL_OK;
+ }
+
joinObjPtr = (objc == 2) ? Tcl_NewStringObj(" ", 1) : objv[2];
Tcl_IncrRefCount(joinObjPtr);
- resObjPtr = Tcl_NewObj();
- for (i = 0; i < listLen; i++) {
- if (i > 0) {
- Tcl_AppendObjToObj(resObjPtr, joinObjPtr);
+ if (Tcl_GetCharLength(joinObjPtr) == 0) {
+ TclStringCatObjv(interp, /* inPlace */ 0, listLen, elemPtrs,
+ &resObjPtr);
+ } else {
+ int i;
+
+ resObjPtr = Tcl_NewObj();
+ for (i = 0; i < listLen; i++) {
+ if (i > 0) {
+
+ /*
+ * NOTE: This code is relying on Tcl_AppendObjToObj() **NOT**
+ * to shimmer joinObjPtr. If it did, then the case where
+ * objv[1] and objv[2] are the same value would not be safe.
+ * Accessing elemPtrs would crash.
+ */
+
+ Tcl_AppendObjToObj(resObjPtr, joinObjPtr);
+ }
+ Tcl_AppendObjToObj(resObjPtr, elemPtrs[i]);
}
- Tcl_AppendObjToObj(resObjPtr, elemPtrs[i]);
}
Tcl_DecrRefCount(joinObjPtr);
- Tcl_SetObjResult(interp, resObjPtr);
- return TCL_OK;
+ if (resObjPtr) {
+ Tcl_SetObjResult(interp, resObjPtr);
+ return TCL_OK;
+ }
+ return TCL_ERROR;
}
/*
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index ab45875..cf046b1 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -2845,7 +2845,7 @@ StringCatCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- int i;
+ int code;
Tcl_Obj *objResultPtr;
if (objc < 2) {
@@ -2862,16 +2862,16 @@ StringCatCmd(
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
}
- objResultPtr = objv[1];
- if (Tcl_IsShared(objResultPtr)) {
- objResultPtr = Tcl_DuplicateObj(objResultPtr);
- }
- for(i = 2;i < objc;i++) {
- Tcl_AppendObjToObj(objResultPtr, objv[i]);
+
+ code = TclStringCatObjv(interp, /* inPlace */ 1, objc-1, objv+1,
+ &objResultPtr);
+
+ if (code == TCL_OK) {
+ Tcl_SetObjResult(interp, objResultPtr);
+ return TCL_OK;
}
- Tcl_SetObjResult(interp, objResultPtr);
- return TCL_OK;
+ return code;
}
/*
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index e52edb5..5680522 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -2303,7 +2303,7 @@ DictAppendCmd(
Tcl_Obj *const *objv)
{
Tcl_Obj *dictPtr, *valuePtr, *resultPtr;
- int i, allocatedDict = 0;
+ int allocatedDict = 0;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 1, objv, "dictVarName key ?value ...?");
@@ -2326,17 +2326,44 @@ DictAppendCmd(
return TCL_ERROR;
}
- if (valuePtr == NULL) {
- TclNewObj(valuePtr);
- } else if (Tcl_IsShared(valuePtr)) {
- valuePtr = Tcl_DuplicateObj(valuePtr);
- }
+ if ((objc > 3) || (valuePtr == NULL)) {
+ /* Only go through append activites when something will change. */
+ Tcl_Obj *appendObjPtr = NULL;
- for (i=3 ; i<objc ; i++) {
- Tcl_AppendObjToObj(valuePtr, objv[i]);
+ if (objc > 3) {
+ /* Something to append */
+
+ if (objc == 4) {
+ appendObjPtr = objv[3];
+ } else if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1,
+ objc-3, objv+3, &appendObjPtr)) {
+ return TCL_ERROR;
+ }
+ }
+
+ if (appendObjPtr == NULL) {
+ /* => (objc == 3) => (valuePtr == NULL) */
+ TclNewObj(valuePtr);
+ } else if (valuePtr == NULL) {
+ valuePtr = appendObjPtr;
+ appendObjPtr = NULL;
+ }
+
+ if (appendObjPtr) {
+ if (Tcl_IsShared(valuePtr)) {
+ valuePtr = Tcl_DuplicateObj(valuePtr);
+ }
+
+ Tcl_AppendObjToObj(valuePtr, appendObjPtr);
+ }
+
+ Tcl_DictObjPut(NULL, dictPtr, objv[2], valuePtr);
}
- Tcl_DictObjPut(NULL, dictPtr, objv[2], valuePtr);
+ /*
+ * Even if nothing changed, we still overwrite so that variable
+ * trace expectations are met.
+ */
resultPtr = Tcl_ObjSetVar2(interp, objv[1], NULL, dictPtr,
TCL_LEAVE_ERR_MSG);
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 417399b..759e4a4 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2692,154 +2692,18 @@ TEBCresume(
NEXT_INST_F(5, 0, 0);
}
- case INST_STR_CONCAT1: {
- int appendLen = 0;
- char *bytes, *p;
- Tcl_Obj **currPtr;
- int onlyb = 1;
+ case INST_STR_CONCAT1:
opnd = TclGetUInt1AtPtr(pc+1);
- /*
- * Detect only-bytearray-or-null case.
- */
-
- for (currPtr=&OBJ_AT_DEPTH(opnd-1); currPtr<=&OBJ_AT_TOS; currPtr++) {
- if (((*currPtr)->typePtr != &tclByteArrayType)
- && ((*currPtr)->bytes != tclEmptyStringRep)) {
- onlyb = 0;
- break;
- } else if (((*currPtr)->typePtr == &tclByteArrayType) &&
- ((*currPtr)->bytes != NULL)) {
- onlyb = 0;
- break;
- }
- }
-
- /*
- * Compute the length to be appended.
- */
-
- if (onlyb) {
- for (currPtr = &OBJ_AT_DEPTH(opnd-2);
- appendLen >= 0 && currPtr <= &OBJ_AT_TOS; currPtr++) {
- if ((*currPtr)->bytes != tclEmptyStringRep) {
- Tcl_GetByteArrayFromObj(*currPtr, &length);
- appendLen += length;
- }
- }
- } else {
- for (currPtr = &OBJ_AT_DEPTH(opnd-2);
- appendLen >= 0 && currPtr <= &OBJ_AT_TOS; currPtr++) {
- bytes = TclGetStringFromObj(*currPtr, &length);
- if (bytes != NULL) {
- appendLen += length;
- }
- }
- }
-
- if (appendLen < 0) {
- /* TODO: convert panic to error ? */
- Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
- }
-
- /*
- * If nothing is to be appended, just return the first object by
- * dropping all the others from the stack; this saves both the
- * computation and copy of the string rep of the first object,
- * enabling the fast '$x[set x {}]' idiom for 'K $x [set x {}]'.
- */
-
- if (appendLen == 0) {
- TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
- NEXT_INST_V(2, (opnd-1), 0);
- }
-
- /*
- * If the first object is shared, we need a new obj for the result;
- * otherwise, we can reuse the first object. In any case, make sure it
- * has enough room to accomodate all the concatenated bytes. Note that
- * if it is unshared its bytes are copied by ckrealloc, so that we set
- * the loop parameters to avoid copying them again: p points to the
- * end of the already copied bytes, currPtr to the second object.
- */
-
- objResultPtr = OBJ_AT_DEPTH(opnd-1);
- if (!onlyb) {
- bytes = TclGetStringFromObj(objResultPtr, &length);
- if (length + appendLen < 0) {
- /* TODO: convert panic to error ? */
- Tcl_Panic("max size for a Tcl value (%d bytes) exceeded",
- INT_MAX);
- }
-#ifndef TCL_COMPILE_DEBUG
- if (bytes != tclEmptyStringRep && !Tcl_IsShared(objResultPtr)) {
- TclFreeIntRep(objResultPtr);
- objResultPtr->bytes = ckrealloc(bytes, length+appendLen+1);
- objResultPtr->length = length + appendLen;
- p = TclGetString(objResultPtr) + length;
- currPtr = &OBJ_AT_DEPTH(opnd - 2);
- } else
-#endif
- {
- p = ckalloc(length + appendLen + 1);
- TclNewObj(objResultPtr);
- objResultPtr->bytes = p;
- objResultPtr->length = length + appendLen;
- currPtr = &OBJ_AT_DEPTH(opnd - 1);
- }
-
- /*
- * Append the remaining characters.
- */
-
- for (; currPtr <= &OBJ_AT_TOS; currPtr++) {
- bytes = TclGetStringFromObj(*currPtr, &length);
- if (bytes != NULL) {
- memcpy(p, bytes, (size_t) length);
- p += length;
- }
- }
- *p = '\0';
- } else {
- bytes = (char *) Tcl_GetByteArrayFromObj(objResultPtr, &length);
- if (length + appendLen < 0) {
- /* TODO: convert panic to error ? */
- Tcl_Panic("max size for a Tcl value (%d bytes) exceeded",
- INT_MAX);
- }
-#ifndef TCL_COMPILE_DEBUG
- if (!Tcl_IsShared(objResultPtr)) {
- bytes = (char *) Tcl_SetByteArrayLength(objResultPtr,
- length + appendLen);
- p = bytes + length;
- currPtr = &OBJ_AT_DEPTH(opnd - 2);
- } else
-#endif
- {
- TclNewObj(objResultPtr);
- bytes = (char *) Tcl_SetByteArrayLength(objResultPtr,
- length + appendLen);
- p = bytes;
- currPtr = &OBJ_AT_DEPTH(opnd - 1);
- }
-
- /*
- * Append the remaining characters.
- */
-
- for (; currPtr <= &OBJ_AT_TOS; currPtr++) {
- if ((*currPtr)->bytes != tclEmptyStringRep) {
- bytes = (char *) Tcl_GetByteArrayFromObj(*currPtr,&length);
- memcpy(p, bytes, (size_t) length);
- p += length;
- }
- }
+ if (TCL_OK != TclStringCatObjv(interp, /* inPlace */ 1,
+ opnd, &OBJ_AT_DEPTH(opnd-1), &objResultPtr)) {
+ TRACE_ERROR(interp);
+ goto gotError;
}
TRACE_WITH_OBJ(("%u => ", opnd), objResultPtr);
NEXT_INST_V(2, opnd, 1);
- }
case INST_CONCAT_STK:
/*
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 89d9f32..0e9a7a2 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3137,6 +3137,9 @@ MODULE_SCOPE void TclSpellFix(Tcl_Interp *interp,
Tcl_Obj *bad, Tcl_Obj *fix);
MODULE_SCOPE void * TclStackRealloc(Tcl_Interp *interp, void *ptr,
int numBytes);
+MODULE_SCOPE int TclStringCatObjv(Tcl_Interp *interp, int inPlace,
+ int objc, Tcl_Obj *const objv[],
+ Tcl_Obj **objPtrPtr);
MODULE_SCOPE int TclStringMatch(const char *str, int strLen,
const char *pattern, int ptnLen, int flags);
MODULE_SCOPE int TclStringMatchObj(Tcl_Obj *stringObj,
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 1975970..61ff2fc 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -409,6 +409,15 @@ Tcl_GetCharLength(
int numChars;
/*
+ * Quick, no-shimmer return for short string reps.
+ */
+
+ if ((objPtr->bytes) && (objPtr->length < 2)) {
+ /* 0 bytes -> 0 chars; 1 byte -> 1 char */
+ return objPtr->length;
+ }
+
+ /*
* Optimize the case where we're really dealing with a bytearray object
* without string representation; we don't need to convert to a string to
* perform the get-length operation.
@@ -1173,6 +1182,8 @@ Tcl_AppendUnicodeToObj(
* Side effects:
* The string rep of appendObjPtr is appended to the string
* representation of objPtr.
+ * IMPORTANT: This routine does not and MUST NOT shimmer appendObjPtr.
+ * Callers are counting on that.
*
*----------------------------------------------------------------------
*/
@@ -2598,6 +2609,235 @@ TclGetStringStorage(
*sizePtr = stringPtr->allocated;
return objPtr->bytes;
}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TclStringCatObjv --
+ *
+ * Performs the [string cat] function.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * Writes to *objPtrPtr the address of Tcl_Obj that is concatenation
+ * of all objc values in objv.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+TclStringCatObjv(
+ Tcl_Interp *interp,
+ int inPlace,
+ int objc,
+ Tcl_Obj * const objv[],
+ Tcl_Obj **objPtrPtr)
+{
+ Tcl_Obj *objPtr, *objResultPtr, * const *ov;
+ int oc, length = 0, binary = 1, first = 0;
+ int allowUniChar = 1, requestUniChar = 0;
+
+ /* assert (objc >= 2) */
+
+ /*
+ * Analyze to determine what representation result should be.
+ * GOALS: Avoid shimmering & string rep generation.
+ * Produce pure bytearray when possible.
+ * Error on overflow.
+ */
+
+ ov = objv, oc = objc;
+ while (oc-- && (binary || allowUniChar)) {
+ objPtr = *ov++;
+
+ if (objPtr->bytes) {
+ /* Value has a string rep. */
+ if (objPtr->length) {
+ /*
+ * Non-empty string rep. Not a pure bytearray, so we
+ * won't create a pure bytearray
+ */
+ binary = 0;
+ if ((objPtr->typePtr) && (objPtr->typePtr != &tclStringType)) {
+ /* Prevent shimmer of non-string types. */
+ allowUniChar = 0;
+ }
+ }
+ } else {
+ /* assert (objPtr->typePtr != NULL) -- stork! */
+ if (TclIsPureByteArray(objPtr)) {
+ allowUniChar = 0;
+ } else {
+ binary = 0;
+ if (objPtr->typePtr == &tclStringType) {
+ /* Have a pure Unicode value; ask to preserve it */
+ requestUniChar = 1;
+ } else {
+ /* Have another type; prevent shimmer */
+ allowUniChar = 0;
+ }
+ }
+ }
+ }
+
+ if (binary) {
+ /* Result will be pure byte array. Pre-size it */
+ ov = objv; oc = objc;
+ while (oc-- && (length >= 0)) {
+ objPtr = *ov++;
+
+ if (objPtr->bytes == NULL) {
+ int numBytes;
+
+ Tcl_GetByteArrayFromObj(objPtr, &numBytes);
+ if (length == 0) {
+ first = objc - oc - 1;
+ }
+ length += numBytes;
+ }
+ }
+ } else if (allowUniChar && requestUniChar) {
+ /* Result will be pure Tcl_UniChar array. Pre-size it. */
+ ov = objv; oc = objc;
+ while (oc-- && (length >= 0)) {
+ objPtr = *ov++;
+
+ if ((objPtr->bytes == NULL) || (objPtr->length)) {
+ int numChars;
+
+ Tcl_GetUnicodeFromObj(objPtr, &numChars);
+ if (length == 0) {
+ first = objc - oc - 1;
+ }
+ length += numChars;
+ }
+ }
+ } else {
+ /* Result will be concat of string reps. Pre-size it. */
+ ov = objv; oc = objc;
+ while (oc-- && (length >= 0)) {
+ int numBytes;
+
+ objPtr = *ov++;
+
+ Tcl_GetStringFromObj(objPtr, &numBytes);
+ if ((length == 0) && numBytes) {
+ first = objc - oc - 1;
+ }
+ length += numBytes;
+ }
+ }
+
+ if (length < 0) {
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "max size for a Tcl value (%d bytes) exceeded", INT_MAX));
+ Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
+ }
+ return TCL_ERROR;
+ }
+
+ if (length == 0) {
+ /* Total length of zero means every value has length zero */
+ *objPtrPtr = objv[0];
+ return TCL_OK;
+ }
+
+ objv += first; objc -= first;
+
+ if (binary) {
+ /* Efficiently produce a pure byte array result */
+ unsigned char *dst;
+
+ if (inPlace && !Tcl_IsShared(*objv)) {
+ int start;
+
+ objResultPtr = *objv++; objc--;
+ Tcl_GetByteArrayFromObj(objResultPtr, &start);
+ dst = Tcl_SetByteArrayLength(objResultPtr, length) + start;
+ } else {
+ objResultPtr = Tcl_NewByteArrayObj(NULL, length);
+ dst = Tcl_SetByteArrayLength(objResultPtr, length);
+ }
+ while (objc--) {
+ Tcl_Obj *objPtr = *objv++;
+
+ if (objPtr->bytes == NULL) {
+ int more;
+ unsigned char *src = Tcl_GetByteArrayFromObj(objPtr, &more);
+ memcpy(dst, src, (size_t) more);
+ dst += more;
+ }
+ }
+ } else if (allowUniChar && requestUniChar) {
+ /* Efficiently produce a pure Tcl_UniChar array result */
+ Tcl_UniChar *dst;
+
+ if (inPlace && !Tcl_IsShared(*objv)) {
+ int start;
+
+ objResultPtr = *objv++; objc--;
+
+ /* Ugly interface! Force resize of the unicode array. */
+ Tcl_GetUnicodeFromObj(objResultPtr, &start);
+ Tcl_InvalidateStringRep(objResultPtr);
+ Tcl_SetObjLength(objResultPtr, length);
+ dst = Tcl_GetUnicode(objResultPtr) + start;
+ } else {
+ Tcl_UniChar ch = 0;
+
+ /* Ugly interface! No scheme to init array size. */
+ objResultPtr = Tcl_NewUnicodeObj(&ch, 0);
+ Tcl_SetObjLength(objResultPtr, length);
+ dst = Tcl_GetUnicode(objResultPtr);
+ }
+ while (objc--) {
+ Tcl_Obj *objPtr = *objv++;
+
+ if ((objPtr->bytes == NULL) || (objPtr->length)) {
+ int more;
+ Tcl_UniChar *src = Tcl_GetUnicodeFromObj(objPtr, &more);
+ memcpy(dst, src, more * sizeof(Tcl_UniChar));
+ dst += more;
+ }
+ }
+ } else {
+ /* Efficiently concatenate string reps */
+ char *dst;
+
+ if (inPlace && !Tcl_IsShared(*objv)) {
+ int start;
+
+ objResultPtr = *objv++; objc--;
+
+ Tcl_GetStringFromObj(objResultPtr, &start);
+ Tcl_SetObjLength(objResultPtr, length);
+ dst = Tcl_GetString(objResultPtr) + start;
+ if (length > start) {
+ TclFreeIntRep(objResultPtr);
+ }
+ } else {
+ objResultPtr = Tcl_NewObj();
+ Tcl_SetObjLength(objResultPtr, length);
+ dst = Tcl_GetString(objResultPtr);
+ }
+ while (objc--) {
+ Tcl_Obj *objPtr = *objv++;
+
+ if ((objPtr->bytes == NULL) || (objPtr->length)) {
+ int more;
+ char *src = Tcl_GetStringFromObj(objPtr, &more);
+ memcpy(dst, src, (size_t) more);
+ dst += more;
+ }
+ }
+ }
+ *objPtrPtr = objResultPtr;
+ return TCL_OK;
+}
+
/*
*---------------------------------------------------------------------------
*
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index a7e8a8a..7f7aff6 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -177,6 +177,8 @@ static Tcl_ObjCmdProc ZlibStreamPutCmd;
static void ConvertError(Tcl_Interp *interp, int code,
uLong adler);
static Tcl_Obj * ConvertErrorToList(int code, uLong adler);
+static inline int Deflate(z_streamp strm, void *bufferPtr,
+ int bufferSize, int flush, int *writtenPtr);
static void ExtractHeader(gz_header *headerPtr, Tcl_Obj *dictObj);
static int GenerateHeader(Tcl_Interp *interp, Tcl_Obj *dictObj,
GzipHeader *headerPtr, int *extraSizePtr);
@@ -578,6 +580,10 @@ ExtractHeader(
}
}
+/*
+ * Disentangle the worst of how the zlib API is used.
+ */
+
static int
SetInflateDictionary(
z_streamp strm,
@@ -605,6 +611,38 @@ SetDeflateDictionary(
}
return Z_OK;
}
+
+static inline int
+Deflate(
+ z_streamp strm,
+ void *bufferPtr,
+ int bufferSize,
+ int flush,
+ int *writtenPtr)
+{
+ int e;
+
+ strm->next_out = (Bytef *) bufferPtr;
+ strm->avail_out = (unsigned) bufferSize;
+ e = deflate(strm, flush);
+ if (writtenPtr != NULL) {
+ *writtenPtr = bufferSize - strm->avail_out;
+ }
+ return e;
+}
+
+static inline void
+AppendByteArray(
+ Tcl_Obj *listObj,
+ void *buffer,
+ int size)
+{
+ if (size > 0) {
+ Tcl_Obj *baObj = Tcl_NewByteArrayObj((unsigned char *) buffer, size);
+
+ Tcl_ListObjAppendElement(NULL, listObj, baObj);
+ }
+}
/*
*----------------------------------------------------------------------
@@ -1139,6 +1177,8 @@ Tcl_ZlibStreamSetCompressionDictionary(
*----------------------------------------------------------------------
*/
+#define BUFFER_SIZE_LIMIT 0xFFFF
+
int
Tcl_ZlibStreamPut(
Tcl_ZlibStream zshandle, /* As obtained from Tcl_ZlibStreamInit */
@@ -1148,8 +1188,7 @@ Tcl_ZlibStreamPut(
{
ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle;
char *dataTmp = NULL;
- int e, size, outSize;
- Tcl_Obj *obj;
+ int e, size, outSize, toStore;
if (zshPtr->streamEnd) {
if (zshPtr->interp) {
@@ -1175,26 +1214,45 @@ Tcl_ZlibStreamPut(
if (HaveDictToSet(zshPtr)) {
e = SetDeflateDictionary(&zshPtr->stream, zshPtr->compDictObj);
if (e != Z_OK) {
- if (zshPtr->interp) {
- ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
- }
+ ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
return TCL_ERROR;
}
DictWasSet(zshPtr);
}
/*
- * Deflatebound doesn't seem to take various header sizes into
- * account, so we add 100 extra bytes.
+ * deflateBound() doesn't seem to take various header sizes into
+ * account, so we add 100 extra bytes. However, we can also loop
+ * around again so we also set an upper bound on the output buffer
+ * size.
*/
- outSize = deflateBound(&zshPtr->stream, zshPtr->stream.avail_in)+100;
- zshPtr->stream.avail_out = outSize;
- dataTmp = ckalloc(zshPtr->stream.avail_out);
- zshPtr->stream.next_out = (Bytef *) dataTmp;
+ outSize = deflateBound(&zshPtr->stream, size) + 100;
+ if (outSize > BUFFER_SIZE_LIMIT) {
+ outSize = BUFFER_SIZE_LIMIT;
+ }
+ dataTmp = ckalloc(outSize);
+
+ while (1) {
+ e = Deflate(&zshPtr->stream, dataTmp, outSize, flush, &toStore);
+
+ /*
+ * Test if we've filled the buffer up and have to ask deflate() to
+ * give us some more. Note that the condition for needing to
+ * repeat a buffer transfer when the result is Z_OK is whether
+ * there is no more space in the buffer we provided; the zlib
+ * library does not necessarily return a different code in that
+ * case. [Bug b26e38a3e4] [Tk Bug 10f2e7872b]
+ */
+
+ if ((e != Z_BUF_ERROR) && (e != Z_OK || toStore < outSize)) {
+ if ((e == Z_OK) || (flush == Z_FINISH && e == Z_STREAM_END)) {
+ break;
+ }
+ ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
+ return TCL_ERROR;
+ }
- e = deflate(&zshPtr->stream, flush);
- while (e == Z_BUF_ERROR || (flush == Z_FINISH && e == Z_OK)) {
/*
* Output buffer too small to hold the data being generated or we
* are doing the end-of-stream flush (which can spit out masses of
@@ -1202,45 +1260,21 @@ Tcl_ZlibStreamPut(
* saving the old generated data to the outData list.
*/
- obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp, outSize);
- Tcl_ListObjAppendElement(NULL, zshPtr->outData, obj);
+ AppendByteArray(zshPtr->outData, dataTmp, outSize);
- if (outSize < 0xFFFF) {
- outSize = 0xFFFF; /* There may be *lots* of data left to
- * output... */
+ if (outSize < BUFFER_SIZE_LIMIT) {
+ outSize = BUFFER_SIZE_LIMIT;
+ /* There may be *lots* of data left to output... */
dataTmp = ckrealloc(dataTmp, outSize);
}
- zshPtr->stream.avail_out = outSize;
- zshPtr->stream.next_out = (Bytef *) dataTmp;
-
- e = deflate(&zshPtr->stream, flush);
- }
-
- if (e != Z_OK && !(flush==Z_FINISH && e==Z_STREAM_END)) {
- if (zshPtr->interp) {
- ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
- }
- return TCL_ERROR;
}
/*
- * And append the final data block.
+ * And append the final data block to the outData list.
*/
- if (outSize - zshPtr->stream.avail_out > 0) {
- obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp,
- outSize - zshPtr->stream.avail_out);
-
- /*
- * Now append the compressed data to the outData list.
- */
-
- Tcl_ListObjAppendElement(NULL, zshPtr->outData, obj);
- }
-
- if (dataTmp) {
- ckfree(dataTmp);
- }
+ AppendByteArray(zshPtr->outData, dataTmp, toStore);
+ ckfree(dataTmp);
} else {
/*
* This is easy. Just append to the inData list.
@@ -1356,9 +1390,7 @@ Tcl_ZlibStreamGet(
if (IsRawStream(zshPtr) && HaveDictToSet(zshPtr)) {
e = SetInflateDictionary(&zshPtr->stream, zshPtr->compDictObj);
if (e != Z_OK) {
- if (zshPtr->interp) {
- ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
- }
+ ConvertError(zshPtr->interp, e, zshPtr->stream.adler);
return TCL_ERROR;
}
DictWasSet(zshPtr);
@@ -2879,10 +2911,8 @@ ZlibTransformClose(
if (cd->mode == TCL_ZLIB_STREAM_DEFLATE) {
cd->outStream.avail_in = 0;
do {
- cd->outStream.next_out = (Bytef *) cd->outBuffer;
- cd->outStream.avail_out = (unsigned) cd->outAllocated;
- e = deflate(&cd->outStream, Z_FINISH);
- written = cd->outAllocated - cd->outStream.avail_out;
+ e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated,
+ Z_FINISH, &written);
/*
* Can't be sure that deflate() won't declare the buffer to be
@@ -3086,17 +3116,15 @@ ZlibTransformOutput(
cd->outStream.next_in = (Bytef *) buf;
cd->outStream.avail_in = toWrite;
do {
- cd->outStream.next_out = (Bytef *) cd->outBuffer;
- cd->outStream.avail_out = cd->outAllocated;
-
- e = deflate(&cd->outStream, Z_NO_FLUSH);
- produced = cd->outAllocated - cd->outStream.avail_out;
+ e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated,
+ Z_NO_FLUSH, &produced);
if ((e == Z_OK && produced > 0) || e == Z_BUF_ERROR) {
/*
* deflate() indicates that it is out of space by returning
- * Z_BUF_ERROR; in that case, we must write the whole buffer out
- * and retry to compress what is left.
+ * Z_BUF_ERROR *or* by simply returning Z_OK with no remaining
+ * space; in either case, we must write the whole buffer out and
+ * retry to compress what is left.
*/
if (e == Z_BUF_ERROR) {
@@ -3149,10 +3177,8 @@ ZlibTransformFlush(
* Get the bytes to go out of the compression engine.
*/
- cd->outStream.next_out = (Bytef *) cd->outBuffer;
- cd->outStream.avail_out = cd->outAllocated;
-
- e = deflate(&cd->outStream, flushType);
+ e = Deflate(&cd->outStream, cd->outBuffer, cd->outAllocated,
+ flushType, &len);
if (e != Z_OK && e != Z_BUF_ERROR) {
ConvertError(interp, e, cd->outStream.adler);
return TCL_ERROR;
@@ -3162,7 +3188,6 @@ ZlibTransformFlush(
* Write the bytes we've received to the next layer.
*/
- len = cd->outStream.next_out - (Bytef *) cd->outBuffer;
if (len > 0 && Tcl_WriteRaw(cd->parent, cd->outBuffer, len) < 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"problem flushing channel: %s",
diff --git a/library/history.tcl b/library/history.tcl
index 51d2404..ef9099b 100644
--- a/library/history.tcl
+++ b/library/history.tcl
@@ -56,6 +56,30 @@ proc ::history {args} {
tailcall apply {arglist {tailcall history {*}$arglist} ::tcl} $args
}
+# (unnamed) --
+#
+# Callback when [::history] is destroyed. Destroys the implementation.
+#
+# Parameters:
+# oldName what the command was called.
+# newName what the command is now called (an empty string).
+# op the operation (= delete).
+#
+# Results:
+# none
+#
+# Side Effects:
+# The implementation of the [::history] command ceases to exist.
+
+trace add command ::history delete [list apply {{oldName newName op} {
+ variable history
+ unset -nocomplain history
+ foreach c [info procs ::tcl::Hist*] {
+ rename $c {}
+ }
+ rename ::tcl::history {}
+} ::tcl}]
+
# tcl::HistAdd --
#
# Add an item to the history, and optionally eval it at the global scope
diff --git a/library/tzdata/Asia/Colombo b/library/tzdata/Asia/Colombo
index ca7bffc..7a14a9b 100644
--- a/library/tzdata/Asia/Colombo
+++ b/library/tzdata/Asia/Colombo
@@ -3,11 +3,11 @@
set TZData(:Asia/Colombo) {
{-9223372036854775808 19164 0 LMT}
{-2840159964 19172 0 MMT}
- {-2019705572 19800 0 IST}
- {-883287000 21600 1 IHST}
- {-862639200 23400 1 IST}
- {-764051400 19800 0 IST}
- {832962600 23400 0 LKT}
- {846266400 21600 0 LKT}
- {1145039400 19800 0 IST}
+ {-2019705572 19800 0 +0530}
+ {-883287000 21600 1 +06}
+ {-862639200 23400 1 +0630}
+ {-764051400 19800 0 +0530}
+ {832962600 23400 0 +0630}
+ {846266400 21600 0 +06}
+ {1145039400 19800 0 +0530}
}
diff --git a/library/tzdata/Asia/Gaza b/library/tzdata/Asia/Gaza
index 6adfe6d..ab53317 100644
--- a/library/tzdata/Asia/Gaza
+++ b/library/tzdata/Asia/Gaza
@@ -108,171 +108,171 @@ set TZData(:Asia/Gaza) {
{1427493600 10800 1 EEST}
{1445547600 7200 0 EET}
{1458946800 10800 1 EEST}
- {1476997200 7200 0 EET}
+ {1477692000 7200 0 EET}
{1490396400 10800 1 EEST}
- {1509051600 7200 0 EET}
+ {1509141600 7200 0 EET}
{1522450800 10800 1 EEST}
- {1540501200 7200 0 EET}
+ {1540591200 7200 0 EET}
{1553900400 10800 1 EEST}
- {1571950800 7200 0 EET}
+ {1572040800 7200 0 EET}
{1585350000 10800 1 EEST}
- {1603400400 7200 0 EET}
+ {1604095200 7200 0 EET}
{1616799600 10800 1 EEST}
- {1634850000 7200 0 EET}
+ {1635544800 7200 0 EET}
{1648249200 10800 1 EEST}
- {1666299600 7200 0 EET}
+ {1666994400 7200 0 EET}
{1679698800 10800 1 EEST}
- {1698354000 7200 0 EET}
+ {1698444000 7200 0 EET}
{1711753200 10800 1 EEST}
- {1729803600 7200 0 EET}
+ {1729893600 7200 0 EET}
{1743202800 10800 1 EEST}
- {1761253200 7200 0 EET}
+ {1761343200 7200 0 EET}
{1774652400 10800 1 EEST}
- {1792702800 7200 0 EET}
+ {1793397600 7200 0 EET}
{1806102000 10800 1 EEST}
- {1824152400 7200 0 EET}
+ {1824847200 7200 0 EET}
{1837551600 10800 1 EEST}
- {1856206800 7200 0 EET}
+ {1856296800 7200 0 EET}
{1869606000 10800 1 EEST}
- {1887656400 7200 0 EET}
+ {1887746400 7200 0 EET}
{1901055600 10800 1 EEST}
- {1919106000 7200 0 EET}
+ {1919196000 7200 0 EET}
{1932505200 10800 1 EEST}
- {1950555600 7200 0 EET}
+ {1950645600 7200 0 EET}
{1963954800 10800 1 EEST}
- {1982005200 7200 0 EET}
+ {1982700000 7200 0 EET}
{1995404400 10800 1 EEST}
- {2013454800 7200 0 EET}
+ {2014149600 7200 0 EET}
{2026854000 10800 1 EEST}
- {2045509200 7200 0 EET}
+ {2045599200 7200 0 EET}
{2058908400 10800 1 EEST}
- {2076958800 7200 0 EET}
+ {2077048800 7200 0 EET}
{2090358000 10800 1 EEST}
- {2108408400 7200 0 EET}
+ {2108498400 7200 0 EET}
{2121807600 10800 1 EEST}
- {2139858000 7200 0 EET}
+ {2140552800 7200 0 EET}
{2153257200 10800 1 EEST}
- {2171307600 7200 0 EET}
+ {2172002400 7200 0 EET}
{2184706800 10800 1 EEST}
- {2202757200 7200 0 EET}
+ {2203452000 7200 0 EET}
{2216761200 10800 1 EEST}
- {2234811600 7200 0 EET}
+ {2234901600 7200 0 EET}
{2248210800 10800 1 EEST}
- {2266261200 7200 0 EET}
+ {2266351200 7200 0 EET}
{2279660400 10800 1 EEST}
- {2297710800 7200 0 EET}
+ {2297800800 7200 0 EET}
{2311110000 10800 1 EEST}
- {2329160400 7200 0 EET}
+ {2329855200 7200 0 EET}
{2342559600 10800 1 EEST}
- {2360610000 7200 0 EET}
+ {2361304800 7200 0 EET}
{2374009200 10800 1 EEST}
- {2392664400 7200 0 EET}
+ {2392754400 7200 0 EET}
{2406063600 10800 1 EEST}
- {2424114000 7200 0 EET}
+ {2424204000 7200 0 EET}
{2437513200 10800 1 EEST}
- {2455563600 7200 0 EET}
+ {2455653600 7200 0 EET}
{2468962800 10800 1 EEST}
- {2487013200 7200 0 EET}
+ {2487708000 7200 0 EET}
{2500412400 10800 1 EEST}
- {2518462800 7200 0 EET}
+ {2519157600 7200 0 EET}
{2531862000 10800 1 EEST}
- {2549912400 7200 0 EET}
+ {2550607200 7200 0 EET}
{2563311600 10800 1 EEST}
- {2581966800 7200 0 EET}
+ {2582056800 7200 0 EET}
{2595366000 10800 1 EEST}
- {2613416400 7200 0 EET}
+ {2613506400 7200 0 EET}
{2626815600 10800 1 EEST}
- {2644866000 7200 0 EET}
+ {2644956000 7200 0 EET}
{2658265200 10800 1 EEST}
- {2676315600 7200 0 EET}
+ {2677010400 7200 0 EET}
{2689714800 10800 1 EEST}
- {2707765200 7200 0 EET}
+ {2708460000 7200 0 EET}
{2721164400 10800 1 EEST}
- {2739819600 7200 0 EET}
+ {2739909600 7200 0 EET}
{2753218800 10800 1 EEST}
- {2771269200 7200 0 EET}
+ {2771359200 7200 0 EET}
{2784668400 10800 1 EEST}
- {2802718800 7200 0 EET}
+ {2802808800 7200 0 EET}
{2816118000 10800 1 EEST}
- {2834168400 7200 0 EET}
+ {2834258400 7200 0 EET}
{2847567600 10800 1 EEST}
- {2865618000 7200 0 EET}
+ {2866312800 7200 0 EET}
{2879017200 10800 1 EEST}
- {2897067600 7200 0 EET}
+ {2897762400 7200 0 EET}
{2910466800 10800 1 EEST}
- {2929122000 7200 0 EET}
+ {2929212000 7200 0 EET}
{2942521200 10800 1 EEST}
- {2960571600 7200 0 EET}
+ {2960661600 7200 0 EET}
{2973970800 10800 1 EEST}
- {2992021200 7200 0 EET}
+ {2992111200 7200 0 EET}
{3005420400 10800 1 EEST}
- {3023470800 7200 0 EET}
+ {3024165600 7200 0 EET}
{3036870000 10800 1 EEST}
- {3054920400 7200 0 EET}
+ {3055615200 7200 0 EET}
{3068319600 10800 1 EEST}
- {3086370000 7200 0 EET}
+ {3087064800 7200 0 EET}
{3100374000 10800 1 EEST}
- {3118424400 7200 0 EET}
+ {3118514400 7200 0 EET}
{3131823600 10800 1 EEST}
- {3149874000 7200 0 EET}
+ {3149964000 7200 0 EET}
{3163273200 10800 1 EEST}
- {3181323600 7200 0 EET}
+ {3181413600 7200 0 EET}
{3194722800 10800 1 EEST}
- {3212773200 7200 0 EET}
+ {3213468000 7200 0 EET}
{3226172400 10800 1 EEST}
- {3244222800 7200 0 EET}
+ {3244917600 7200 0 EET}
{3257622000 10800 1 EEST}
- {3276277200 7200 0 EET}
+ {3276367200 7200 0 EET}
{3289676400 10800 1 EEST}
- {3307726800 7200 0 EET}
+ {3307816800 7200 0 EET}
{3321126000 10800 1 EEST}
- {3339176400 7200 0 EET}
+ {3339266400 7200 0 EET}
{3352575600 10800 1 EEST}
- {3370626000 7200 0 EET}
+ {3371320800 7200 0 EET}
{3384025200 10800 1 EEST}
- {3402075600 7200 0 EET}
+ {3402770400 7200 0 EET}
{3415474800 10800 1 EEST}
- {3433525200 7200 0 EET}
+ {3434220000 7200 0 EET}
{3446924400 10800 1 EEST}
- {3465579600 7200 0 EET}
+ {3465669600 7200 0 EET}
{3478978800 10800 1 EEST}
- {3497029200 7200 0 EET}
+ {3497119200 7200 0 EET}
{3510428400 10800 1 EEST}
- {3528478800 7200 0 EET}
+ {3528568800 7200 0 EET}
{3541878000 10800 1 EEST}
- {3559928400 7200 0 EET}
+ {3560623200 7200 0 EET}
{3573327600 10800 1 EEST}
- {3591378000 7200 0 EET}
+ {3592072800 7200 0 EET}
{3604777200 10800 1 EEST}
- {3623432400 7200 0 EET}
+ {3623522400 7200 0 EET}
{3636831600 10800 1 EEST}
- {3654882000 7200 0 EET}
+ {3654972000 7200 0 EET}
{3668281200 10800 1 EEST}
- {3686331600 7200 0 EET}
+ {3686421600 7200 0 EET}
{3699730800 10800 1 EEST}
- {3717781200 7200 0 EET}
+ {3717871200 7200 0 EET}
{3731180400 10800 1 EEST}
- {3749230800 7200 0 EET}
+ {3749925600 7200 0 EET}
{3762630000 10800 1 EEST}
- {3780680400 7200 0 EET}
+ {3781375200 7200 0 EET}
{3794079600 10800 1 EEST}
- {3812734800 7200 0 EET}
+ {3812824800 7200 0 EET}
{3826134000 10800 1 EEST}
- {3844184400 7200 0 EET}
+ {3844274400 7200 0 EET}
{3857583600 10800 1 EEST}
- {3875634000 7200 0 EET}
+ {3875724000 7200 0 EET}
{3889033200 10800 1 EEST}
- {3907083600 7200 0 EET}
+ {3907778400 7200 0 EET}
{3920482800 10800 1 EEST}
- {3938533200 7200 0 EET}
+ {3939228000 7200 0 EET}
{3951932400 10800 1 EEST}
- {3969982800 7200 0 EET}
+ {3970677600 7200 0 EET}
{3983986800 10800 1 EEST}
- {4002037200 7200 0 EET}
+ {4002127200 7200 0 EET}
{4015436400 10800 1 EEST}
- {4033486800 7200 0 EET}
+ {4033576800 7200 0 EET}
{4046886000 10800 1 EEST}
- {4064936400 7200 0 EET}
+ {4065026400 7200 0 EET}
{4078335600 10800 1 EEST}
- {4096386000 7200 0 EET}
+ {4097080800 7200 0 EET}
}
diff --git a/library/tzdata/Asia/Hebron b/library/tzdata/Asia/Hebron
index 2db45f2..c9f94f2 100644
--- a/library/tzdata/Asia/Hebron
+++ b/library/tzdata/Asia/Hebron
@@ -107,171 +107,171 @@ set TZData(:Asia/Hebron) {
{1427493600 10800 1 EEST}
{1445547600 7200 0 EET}
{1458946800 10800 1 EEST}
- {1476997200 7200 0 EET}
+ {1477692000 7200 0 EET}
{1490396400 10800 1 EEST}
- {1509051600 7200 0 EET}
+ {1509141600 7200 0 EET}
{1522450800 10800 1 EEST}
- {1540501200 7200 0 EET}
+ {1540591200 7200 0 EET}
{1553900400 10800 1 EEST}
- {1571950800 7200 0 EET}
+ {1572040800 7200 0 EET}
{1585350000 10800 1 EEST}
- {1603400400 7200 0 EET}
+ {1604095200 7200 0 EET}
{1616799600 10800 1 EEST}
- {1634850000 7200 0 EET}
+ {1635544800 7200 0 EET}
{1648249200 10800 1 EEST}
- {1666299600 7200 0 EET}
+ {1666994400 7200 0 EET}
{1679698800 10800 1 EEST}
- {1698354000 7200 0 EET}
+ {1698444000 7200 0 EET}
{1711753200 10800 1 EEST}
- {1729803600 7200 0 EET}
+ {1729893600 7200 0 EET}
{1743202800 10800 1 EEST}
- {1761253200 7200 0 EET}
+ {1761343200 7200 0 EET}
{1774652400 10800 1 EEST}
- {1792702800 7200 0 EET}
+ {1793397600 7200 0 EET}
{1806102000 10800 1 EEST}
- {1824152400 7200 0 EET}
+ {1824847200 7200 0 EET}
{1837551600 10800 1 EEST}
- {1856206800 7200 0 EET}
+ {1856296800 7200 0 EET}
{1869606000 10800 1 EEST}
- {1887656400 7200 0 EET}
+ {1887746400 7200 0 EET}
{1901055600 10800 1 EEST}
- {1919106000 7200 0 EET}
+ {1919196000 7200 0 EET}
{1932505200 10800 1 EEST}
- {1950555600 7200 0 EET}
+ {1950645600 7200 0 EET}
{1963954800 10800 1 EEST}
- {1982005200 7200 0 EET}
+ {1982700000 7200 0 EET}
{1995404400 10800 1 EEST}
- {2013454800 7200 0 EET}
+ {2014149600 7200 0 EET}
{2026854000 10800 1 EEST}
- {2045509200 7200 0 EET}
+ {2045599200 7200 0 EET}
{2058908400 10800 1 EEST}
- {2076958800 7200 0 EET}
+ {2077048800 7200 0 EET}
{2090358000 10800 1 EEST}
- {2108408400 7200 0 EET}
+ {2108498400 7200 0 EET}
{2121807600 10800 1 EEST}
- {2139858000 7200 0 EET}
+ {2140552800 7200 0 EET}
{2153257200 10800 1 EEST}
- {2171307600 7200 0 EET}
+ {2172002400 7200 0 EET}
{2184706800 10800 1 EEST}
- {2202757200 7200 0 EET}
+ {2203452000 7200 0 EET}
{2216761200 10800 1 EEST}
- {2234811600 7200 0 EET}
+ {2234901600 7200 0 EET}
{2248210800 10800 1 EEST}
- {2266261200 7200 0 EET}
+ {2266351200 7200 0 EET}
{2279660400 10800 1 EEST}
- {2297710800 7200 0 EET}
+ {2297800800 7200 0 EET}
{2311110000 10800 1 EEST}
- {2329160400 7200 0 EET}
+ {2329855200 7200 0 EET}
{2342559600 10800 1 EEST}
- {2360610000 7200 0 EET}
+ {2361304800 7200 0 EET}
{2374009200 10800 1 EEST}
- {2392664400 7200 0 EET}
+ {2392754400 7200 0 EET}
{2406063600 10800 1 EEST}
- {2424114000 7200 0 EET}
+ {2424204000 7200 0 EET}
{2437513200 10800 1 EEST}
- {2455563600 7200 0 EET}
+ {2455653600 7200 0 EET}
{2468962800 10800 1 EEST}
- {2487013200 7200 0 EET}
+ {2487708000 7200 0 EET}
{2500412400 10800 1 EEST}
- {2518462800 7200 0 EET}
+ {2519157600 7200 0 EET}
{2531862000 10800 1 EEST}
- {2549912400 7200 0 EET}
+ {2550607200 7200 0 EET}
{2563311600 10800 1 EEST}
- {2581966800 7200 0 EET}
+ {2582056800 7200 0 EET}
{2595366000 10800 1 EEST}
- {2613416400 7200 0 EET}
+ {2613506400 7200 0 EET}
{2626815600 10800 1 EEST}
- {2644866000 7200 0 EET}
+ {2644956000 7200 0 EET}
{2658265200 10800 1 EEST}
- {2676315600 7200 0 EET}
+ {2677010400 7200 0 EET}
{2689714800 10800 1 EEST}
- {2707765200 7200 0 EET}
+ {2708460000 7200 0 EET}
{2721164400 10800 1 EEST}
- {2739819600 7200 0 EET}
+ {2739909600 7200 0 EET}
{2753218800 10800 1 EEST}
- {2771269200 7200 0 EET}
+ {2771359200 7200 0 EET}
{2784668400 10800 1 EEST}
- {2802718800 7200 0 EET}
+ {2802808800 7200 0 EET}
{2816118000 10800 1 EEST}
- {2834168400 7200 0 EET}
+ {2834258400 7200 0 EET}
{2847567600 10800 1 EEST}
- {2865618000 7200 0 EET}
+ {2866312800 7200 0 EET}
{2879017200 10800 1 EEST}
- {2897067600 7200 0 EET}
+ {2897762400 7200 0 EET}
{2910466800 10800 1 EEST}
- {2929122000 7200 0 EET}
+ {2929212000 7200 0 EET}
{2942521200 10800 1 EEST}
- {2960571600 7200 0 EET}
+ {2960661600 7200 0 EET}
{2973970800 10800 1 EEST}
- {2992021200 7200 0 EET}
+ {2992111200 7200 0 EET}
{3005420400 10800 1 EEST}
- {3023470800 7200 0 EET}
+ {3024165600 7200 0 EET}
{3036870000 10800 1 EEST}
- {3054920400 7200 0 EET}
+ {3055615200 7200 0 EET}
{3068319600 10800 1 EEST}
- {3086370000 7200 0 EET}
+ {3087064800 7200 0 EET}
{3100374000 10800 1 EEST}
- {3118424400 7200 0 EET}
+ {3118514400 7200 0 EET}
{3131823600 10800 1 EEST}
- {3149874000 7200 0 EET}
+ {3149964000 7200 0 EET}
{3163273200 10800 1 EEST}
- {3181323600 7200 0 EET}
+ {3181413600 7200 0 EET}
{3194722800 10800 1 EEST}
- {3212773200 7200 0 EET}
+ {3213468000 7200 0 EET}
{3226172400 10800 1 EEST}
- {3244222800 7200 0 EET}
+ {3244917600 7200 0 EET}
{3257622000 10800 1 EEST}
- {3276277200 7200 0 EET}
+ {3276367200 7200 0 EET}
{3289676400 10800 1 EEST}
- {3307726800 7200 0 EET}
+ {3307816800 7200 0 EET}
{3321126000 10800 1 EEST}
- {3339176400 7200 0 EET}
+ {3339266400 7200 0 EET}
{3352575600 10800 1 EEST}
- {3370626000 7200 0 EET}
+ {3371320800 7200 0 EET}
{3384025200 10800 1 EEST}
- {3402075600 7200 0 EET}
+ {3402770400 7200 0 EET}
{3415474800 10800 1 EEST}
- {3433525200 7200 0 EET}
+ {3434220000 7200 0 EET}
{3446924400 10800 1 EEST}
- {3465579600 7200 0 EET}
+ {3465669600 7200 0 EET}
{3478978800 10800 1 EEST}
- {3497029200 7200 0 EET}
+ {3497119200 7200 0 EET}
{3510428400 10800 1 EEST}
- {3528478800 7200 0 EET}
+ {3528568800 7200 0 EET}
{3541878000 10800 1 EEST}
- {3559928400 7200 0 EET}
+ {3560623200 7200 0 EET}
{3573327600 10800 1 EEST}
- {3591378000 7200 0 EET}
+ {3592072800 7200 0 EET}
{3604777200 10800 1 EEST}
- {3623432400 7200 0 EET}
+ {3623522400 7200 0 EET}
{3636831600 10800 1 EEST}
- {3654882000 7200 0 EET}
+ {3654972000 7200 0 EET}
{3668281200 10800 1 EEST}
- {3686331600 7200 0 EET}
+ {3686421600 7200 0 EET}
{3699730800 10800 1 EEST}
- {3717781200 7200 0 EET}
+ {3717871200 7200 0 EET}
{3731180400 10800 1 EEST}
- {3749230800 7200 0 EET}
+ {3749925600 7200 0 EET}
{3762630000 10800 1 EEST}
- {3780680400 7200 0 EET}
+ {3781375200 7200 0 EET}
{3794079600 10800 1 EEST}
- {3812734800 7200 0 EET}
+ {3812824800 7200 0 EET}
{3826134000 10800 1 EEST}
- {3844184400 7200 0 EET}
+ {3844274400 7200 0 EET}
{3857583600 10800 1 EEST}
- {3875634000 7200 0 EET}
+ {3875724000 7200 0 EET}
{3889033200 10800 1 EEST}
- {3907083600 7200 0 EET}
+ {3907778400 7200 0 EET}
{3920482800 10800 1 EEST}
- {3938533200 7200 0 EET}
+ {3939228000 7200 0 EET}
{3951932400 10800 1 EEST}
- {3969982800 7200 0 EET}
+ {3970677600 7200 0 EET}
{3983986800 10800 1 EEST}
- {4002037200 7200 0 EET}
+ {4002127200 7200 0 EET}
{4015436400 10800 1 EEST}
- {4033486800 7200 0 EET}
+ {4033576800 7200 0 EET}
{4046886000 10800 1 EEST}
- {4064936400 7200 0 EET}
+ {4065026400 7200 0 EET}
{4078335600 10800 1 EEST}
- {4096386000 7200 0 EET}
+ {4097080800 7200 0 EET}
}
diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul
index f7b0c24..d00533f 100644
--- a/library/tzdata/Europe/Istanbul
+++ b/library/tzdata/Europe/Istanbul
@@ -71,23 +71,23 @@ set TZData(:Europe/Istanbul) {
{482792400 7200 0 EET}
{482796000 10800 1 EEST}
{496702800 7200 0 EET}
- {512524800 10800 1 EEST}
- {528249600 7200 0 EET}
- {543974400 10800 1 EEST}
- {559699200 7200 0 EET}
- {575424000 10800 1 EEST}
- {591148800 7200 0 EET}
- {606873600 10800 1 EEST}
- {622598400 7200 0 EET}
- {638323200 10800 1 EEST}
- {654652800 7200 0 EET}
+ {512521200 10800 1 EEST}
+ {528246000 7200 0 EET}
+ {543970800 10800 1 EEST}
+ {559695600 7200 0 EET}
+ {575420400 10800 1 EEST}
+ {591145200 7200 0 EET}
+ {606870000 10800 1 EEST}
+ {622594800 7200 0 EET}
+ {638319600 10800 1 EEST}
+ {654649200 7200 0 EET}
{670374000 10800 1 EEST}
{686098800 7200 0 EET}
{701823600 10800 1 EEST}
{717548400 7200 0 EET}
{733273200 10800 1 EEST}
{748998000 7200 0 EET}
- {764722800 10800 1 EEST}
+ {764118000 10800 1 EEST}
{780447600 7200 0 EET}
{796172400 10800 1 EEST}
{811897200 7200 0 EET}
diff --git a/tests/binary.test b/tests/binary.test
index 40b1315..7738f69 100644
--- a/tests/binary.test
+++ b/tests/binary.test
@@ -2837,6 +2837,19 @@ test binary-76.2 {binary string appending growth algorithm} win {
# Append to it
string length [append str [binary format a* foo]]
} 3
+
+test binary-77.1 {string cat ops on all bytearrays} {
+ apply {{a b} {
+ return [binary format H* $a][binary format H* $b]
+ }} ab cd
+} [binary format H* abcd]
+test binary-77.2 {string cat ops on all bytearrays} {
+ apply {{a b} {
+ set one [binary format H* $a]
+ return $one[binary format H* $b]
+ }} ab cd
+} [binary format H* abcd]
+
# ----------------------------------------------------------------------
# cleanup
diff --git a/tests/history.test b/tests/history.test
index c2d2124..9ff41f2 100644
--- a/tests/history.test
+++ b/tests/history.test
@@ -11,8 +11,8 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
-if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
+if {"::tcltest" ni [namespace children]} {
+ package require tcltest 2
namespace import -force ::tcltest::*
}
@@ -245,6 +245,60 @@ test history-9.2 {miscellaneous} history {
catch {history gorp} msg
set msg
} {unknown or ambiguous subcommand "gorp": must be add, change, clear, event, info, keep, nextid, or redo}
+
+# History retains references; Bug 1ae12987cb
+test history-10.1 {references kept by history} -constraints history -setup {
+ interp create histtest
+ histtest eval {
+ # Trigger any autoloading that might be present
+ catch {history}
+ proc refcount {x} {
+ set rep [::tcl::unsupported::representation $x]
+ regexp {with a refcount of (\d+)} $rep -> rc
+ # Ignore the references due to calling this procedure
+ return [expr {$rc - 3}]
+ }
+ }
+} -body {
+ histtest eval {
+ # A fresh object, refcount 1 from the variable we write it to
+ set obj [expr rand()]
+ set baseline [refcount $obj]
+ lappend result [refcount $obj]
+ history add [list list $obj]
+ lappend result [refcount $obj]
+ history clear
+ lappend result [refcount $obj]
+ }
+} -cleanup {
+ interp delete histtest
+} -result {1 2 1}
+test history-10.2 {references kept by history} -constraints history -setup {
+ interp create histtest
+ histtest eval {
+ # Trigger any autoloading that might be present
+ catch {history}
+ proc refcount {x} {
+ set rep [::tcl::unsupported::representation $x]
+ regexp {with a refcount of (\d+)} $rep -> rc
+ # Ignore the references due to calling this procedure
+ return [expr {$rc - 3}]
+ }
+ }
+} -body {
+ histtest eval {
+ # A fresh object, refcount 1 from the variable we write it to
+ set obj [expr rand()]
+ set baseline [refcount $obj]
+ lappend result [refcount $obj]
+ history add [list list $obj]
+ lappend result [refcount $obj]
+ rename history {}
+ lappend result [refcount $obj]
+ }
+} -cleanup {
+ interp delete histtest
+} -result {1 2 1}
# cleanup
::tcltest::cleanupTests
diff --git a/tests/zlib.test b/tests/zlib.test
index 15dbb34..ae8742b 100644
--- a/tests/zlib.test
+++ b/tests/zlib.test
@@ -138,6 +138,25 @@ test zlib-7.7 {zlib stream: Bug 25842c161} -constraints zlib -body {
} -cleanup {
catch {$s close}
} -result ""
+# Also causes Tk Bug 10f2e7872b
+test zlib-7.8 {zlib stream: Bug b26e38a3e4} -constraints zlib -setup {
+ expr srand(12345)
+ set randdata {}
+ for {set i 0} {$i<6001} {incr i} {
+ append randdata [binary format c [expr {int(256*rand())}]]
+ }
+} -body {
+ set strm [zlib stream compress]
+ for {set i 1} {$i<3000} {incr i} {
+ $strm put $randdata
+ }
+ $strm put -finalize $randdata
+ set data [$strm get]
+ list [string length $data] [string length [zlib decompress $data]]
+} -cleanup {
+ catch {$strm close}
+ unset -nocomplain randdata data
+} -result {120185 18003000}
test zlib-8.1 {zlib transformation} -constraints zlib -setup {
set file [makeFile {} test.gz]