diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2011-08-16 09:18:06 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2011-08-16 09:18:06 (GMT) |
commit | 1fb25505b732b94f74aae7edc392508bdd8a30fa (patch) | |
tree | 6d0803a80ce796b40f3601e4c6da7b561ad57f30 | |
parent | 860e6b5e43e0ac7e673218dd929d425c5d206014 (diff) | |
parent | 1be9bc0869341de7806f25de58a35e8320b42ee5 (diff) | |
download | tcl-1fb25505b732b94f74aae7edc392508bdd8a30fa.zip tcl-1fb25505b732b94f74aae7edc392508bdd8a30fa.tar.gz tcl-1fb25505b732b94f74aae7edc392508bdd8a30fa.tar.bz2 |
merge current trunk
-rw-r--r-- | ChangeLog | 36 | ||||
-rw-r--r-- | doc/FindExec.3 | 7 | ||||
-rw-r--r-- | doc/Panic.3 | 20 | ||||
-rw-r--r-- | generic/tclBasic.c | 4 | ||||
-rw-r--r-- | generic/tclPathObj.c | 24 | ||||
-rw-r--r-- | generic/tclPosixStr.c | 4 | ||||
-rw-r--r-- | generic/tclZlib.c | 2 | ||||
-rw-r--r-- | tests/zlib.test | 32 | ||||
-rwxr-xr-x | win/configure | 10 | ||||
-rw-r--r-- | win/configure.in | 14 | ||||
-rw-r--r-- | win/tclWinPort.h | 2 |
11 files changed, 111 insertions, 44 deletions
@@ -1,24 +1,50 @@ +2011-08-15 Don Porter <dgp@users.sourceforge.net> + + * generic/tclBasic.c: [Bug 3390272] Leak of [info script] value. + +2011-08-15 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tclPosixStr.c: [Bug 3388350] mingw64 compiler warnings + * win/tclWinPort.h: + * win/configure.in + * win/configure + +2011-08-14 Jan Nijtmans <nijtmans@users.sf.net> + + * doc/FindExec.3: [Patch 3124554]: Move WishPanic from Tk to Tcl + * doc/Panic.3 Added Documentation + +2011-08-12 Don Porter <dgp@users.sourceforge.net> + + * generic/tclPathObj.c: [Bug 3389764] Eliminate possibility that dup + of a "path" value can create reference cycle. + +2011-08-12 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclZlib.c (ZlibTransformOutput): [Bug 3390073]: Return the + correct length of written data for a compressing transform. + 2011-08-10 Alexandre Ferrieux <ferrieux@users.sourceforge.net> - * generic/tclTestObj.c: [Bug 3386721] Allow multiple [load]ing of - the Tcltest package + * generic/tclTestObj.c: [Bug 3386721]: Allow multiple [load]ing of the + Tcltest package. 2011-08-09 Alexandre Ferrieux <ferrieux@users.sourceforge.net> - * generic/tclBasic.c: [Bug 2919042] Restore "valgrindability" of Tcl + * generic/tclBasic.c: [Bug 2919042]: Restore "valgrindability" of Tcl * generic/tclEvent.c: that was lost by the streamlining of [exit], by * generic/tclExecute.c: conditionally forcing a full Finalize: * generic/tclInt.h: use -DPURIFY or ::env(TCL_FINALIZE_ON_EXIT) 2011-08-09 Alexandre Ferrieux <ferrieux@users.sourceforge.net> - * generic/tclCompCmds.c: [Bug 3386417] avoid a reference loop between + * generic/tclCompCmds.c: [Bug 3386417]: Avoid a reference loop between * generic/tclInt.h: the bytecode and its companion errostack * generic/tclResult.c: when compiling a syntax error. 2011-08-09 Jan Nijtmans <nijtmans@users.sf.net> - * win/tclWinConsole.c: [Bug 3388350] mingw64 compiler warnings + * win/tclWinConsole.c: [Bug 3388350]: mingw64 compiler warnings * win/tclWinDde.c * win/tclWinPipe.c * win/tclWinSerial.c diff --git a/doc/FindExec.3 b/doc/FindExec.3 index 0e225e9..66cc1f1 100644 --- a/doc/FindExec.3 +++ b/doc/FindExec.3 @@ -45,6 +45,13 @@ application's executable, if possible. If it fails to find the binary, then future calls to \fBinfo nameofexecutable\fR will return an empty string. .PP +On Windows platforms this procedure is typically invoked as the very +first thing in the application's main program as well; Its \fIargv[0]\fR +argument is only used to indicate wheter the executable has a stderr +channel (any non-null value) or not (the value null). If \fBTcl_SetPanicProc\fR +is never called and no debugger is running, this determines whether +the panic message is sent to stderr or to a standard system dialog. +.PP \fBTcl_GetNameOfExecutable\fR simply returns a pointer to the internal full path name of the executable file as computed by \fBTcl_FindExecutable\fR. This procedure call is the C API diff --git a/doc/Panic.3 b/doc/Panic.3 index 44eb102..48aed2b 100644 --- a/doc/Panic.3 +++ b/doc/Panic.3 @@ -49,7 +49,10 @@ same formatting rules are also used by the built-in Tcl command In a freshly loaded Tcl library, \fBTcl_Panic\fR prints the formatted error message to the standard error file of the process, and then calls \fBabort\fR to terminate the process. \fBTcl_Panic\fR does not -return. +return. On Windows, when a debugger is running, the formatted error +message is sent to the debugger in stead. If the windows executable +does not have a stderr channel (e.g. \fBwish.exe\fR), then a +system dialog box is used to display the panic message. .PP \fBTcl_SetPanicProc\fR may be used to modify the behavior of \fBTcl_Panic\fR. The \fIpanicProc\fR argument should match the @@ -63,19 +66,14 @@ typedef void \fBTcl_PanicProc\fR( .PP After \fBTcl_SetPanicProc\fR returns, any future calls to \fBTcl_Panic\fR will call \fIpanicProc\fR, passing along the -\fIformat\fR and \fIarg\fR arguments. To maintain consistency with the -callers of \fBTcl_Panic\fR, \fIpanicProc\fR must not return; it must -call \fBabort\fR. \fIpanicProc\fR should avoid making calls into the -Tcl library, or into other libraries that may call the Tcl library, -since the original call to \fBTcl_Panic\fR indicates the Tcl library is -not in a state of reliable operation. +\fIformat\fR and \fIarg\fR arguments. \fIpanicProc\fR should avoid +making calls into the Tcl library, or into other libraries that may +call the Tcl library, since the original call to \fBTcl_Panic\fR +indicates the Tcl library is not in a state of reliable operation. .PP The typical use of \fBTcl_SetPanicProc\fR arranges for the error message to be displayed or reported in a manner more suitable for the -application or the platform. As an example, the Windows implementation -of \fBwish\fR calls \fBTcl_SetPanicProc\fR to force all panic messages -to be displayed in a system dialog box, rather than to be printed to the -standard error file (usually not visible under Windows). +application or the platform. .PP Although the primary callers of \fBTcl_Panic\fR are the procedures of the Tcl library, \fBTcl_Panic\fR is a public function and may be called diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 124f932..f0f0c0f 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -1529,6 +1529,10 @@ DeleteInterpProc( if (iPtr->execEnvPtr != NULL) { TclDeleteExecEnv(iPtr->execEnvPtr); } + if (iPtr->scriptFile) { + Tcl_DecrRefCount(iPtr->scriptFile); + iPtr->scriptFile = NULL; + } Tcl_DecrRefCount(iPtr->emptyObjPtr); iPtr->emptyObjPtr = NULL; diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index d9e3973..205c301 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -2617,29 +2617,29 @@ DupFsPathInternalRep( SETPATHOBJ(copyPtr, copyFsPathPtr); - if (srcFsPathPtr->translatedPathPtr != NULL) { + if (srcFsPathPtr->translatedPathPtr == srcPtr) { + /* Cycle in src -> make cycle in copy. */ + copyFsPathPtr->translatedPathPtr = copyPtr; + } else { copyFsPathPtr->translatedPathPtr = srcFsPathPtr->translatedPathPtr; - if (copyFsPathPtr->translatedPathPtr != copyPtr) { + if (copyFsPathPtr->translatedPathPtr != NULL) { Tcl_IncrRefCount(copyFsPathPtr->translatedPathPtr); } - } else { - copyFsPathPtr->translatedPathPtr = NULL; } - if (srcFsPathPtr->normPathPtr != NULL) { + if (srcFsPathPtr->normPathPtr == srcPtr) { + /* Cycle in src -> make cycle in copy. */ + copyFsPathPtr->normPathPtr = copyPtr; + } else { copyFsPathPtr->normPathPtr = srcFsPathPtr->normPathPtr; - if (copyFsPathPtr->normPathPtr != copyPtr) { + if (copyFsPathPtr->normPathPtr != NULL) { Tcl_IncrRefCount(copyFsPathPtr->normPathPtr); } - } else { - copyFsPathPtr->normPathPtr = NULL; } - if (srcFsPathPtr->cwdPtr != NULL) { - copyFsPathPtr->cwdPtr = srcFsPathPtr->cwdPtr; + copyFsPathPtr->cwdPtr = srcFsPathPtr->cwdPtr; + if (copyFsPathPtr->cwdPtr != NULL) { Tcl_IncrRefCount(copyFsPathPtr->cwdPtr); - } else { - copyFsPathPtr->cwdPtr = NULL; } copyFsPathPtr->flags = srcFsPathPtr->flags; diff --git a/generic/tclPosixStr.c b/generic/tclPosixStr.c index d0002ec..411eb27 100644 --- a/generic/tclPosixStr.c +++ b/generic/tclPosixStr.c @@ -35,7 +35,7 @@ const char * Tcl_ErrnoId(void) { switch (errno) { -#ifdef E2BIG +#if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) case E2BIG: return "E2BIG"; #endif #ifdef EACCES @@ -494,7 +494,7 @@ Tcl_ErrnoMsg( int err) /* Error number (such as in errno variable). */ { switch (err) { -#ifdef E2BIG +#if defined(E2BIG) && (!defined(EOVERFLOW) || (E2BIG != EOVERFLOW)) case E2BIG: return "argument list too long"; #endif #ifdef EACCES diff --git a/generic/tclZlib.c b/generic/tclZlib.c index be91365..81012dc 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -2460,7 +2460,7 @@ ZlibTransformOutput( return -1; } - return toWrite - cd->outStream.avail_out; + return toWrite - cd->outStream.avail_in; } static int diff --git a/tests/zlib.test b/tests/zlib.test index 47eeab8..dac11e4 100644 --- a/tests/zlib.test +++ b/tests/zlib.test @@ -156,6 +156,7 @@ test zlib-8.3 {zlib transformation and fileevent} -constraints zlib -setup { close $srv removeFile $file } -result 81920-->81920 + test zlib-9.1 "check fcopy with push" -constraints zlib -setup { set sfile [makeFile {} testsrc.gz] set file [makeFile {} test.gz] @@ -569,6 +570,37 @@ test zlib-10.2 "bug #2818131 (mismatch gets)" -constraints { rename bgerror {} rename zlibRead {} } -result {error {invalid block type}} + +test zlib-11.1 "Bug #3390073: mis-appled gzip filtering" -setup { + set file [makeFile {} test.input] +} -constraints zlib -body { + set f [open $file wb] + puts -nonewline [zlib push gzip $f] [string repeat "hello" 1000] + close $f + set f [open $file rb] + set d [read $f] + close $f + set d [zlib gunzip $d] + list [regexp -all "hello" $d] [string length [regsub -all "hello" $d {}]] +} -cleanup { + removeFile $file +} -result {1000 0} +test zlib-11.2 "Bug #3390073: mis-appled gzip filtering" -setup { + set file [makeFile {} test.input] +} -constraints zlib -body { + set f [open $file wb] + puts -nonewline [zlib push gzip $f -header {filename /foo/bar}] \ + [string repeat "hello" 1000] + close $f + set f [open $file rb] + set d [read $f] + close $f + set d [zlib gunzip $d -header h] + list [regexp -all "hello" $d] [dict get $h filename] \ + [string length [regsub -all "hello" $d {}]] +} -cleanup { + removeFile $file +} -result {1000 /foo/bar 0} ::tcltest::cleanupTests return diff --git a/win/configure b/win/configure index 3a40da1..94766ff 100755 --- a/win/configure +++ b/win/configure @@ -3485,8 +3485,8 @@ fi # Check to see if struct _stat32i64 exists in mingw's sys/stat.h -echo "$as_me:$LINENO: checking struct _stat32i64" >&5 -echo $ECHO_N "checking struct _stat32i64... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking if struct _stat32i64 missing" >&5 +echo $ECHO_N "checking if struct _stat32i64 missing... $ECHO_C" >&6 if test "${tcl_struct_stat32i64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3532,12 +3532,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - tcl_struct_stat32i64=yes + tcl_struct_stat32i64=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -tcl_struct_stat32i64=no +tcl_struct_stat32i64=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext @@ -3547,7 +3547,7 @@ echo "${ECHO_T}$tcl_struct_stat32i64" >&6 if test "$tcl_struct_stat32i64" = "yes" ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_STRUCT_STAT32I64 1 +#define HAVE_NO_STRUCT_STAT32I64 1 _ACEOF fi diff --git a/win/configure.in b/win/configure.in index cb958f2..a42abdc 100644 --- a/win/configure.in +++ b/win/configure.in @@ -227,7 +227,7 @@ fi # Check to see if struct _stat32i64 exists in mingw's sys/stat.h -AC_CACHE_CHECK(struct _stat32i64, +AC_CACHE_CHECK(if struct _stat32i64 missing, tcl_struct_stat32i64, AC_TRY_COMPILE([ #include <sys/types.h> @@ -236,12 +236,12 @@ AC_TRY_COMPILE([ [ struct _stat32i64 foo; ], - tcl_struct_stat32i64=yes, - tcl_struct_stat32i64=no) + tcl_struct_stat32i64=no, + tcl_struct_stat32i64=yes) ) if test "$tcl_struct_stat32i64" = "yes" ; then - AC_DEFINE(HAVE_STRUCT_STAT32I64, 1, - [Defined when sys/stat.h has struct_stat32i64]) + AC_DEFINE(HAVE_NO_STRUCT_STAT32I64, 1, + [Defined when sys/stat.h is missing struct _stat32i64]) fi @@ -399,7 +399,7 @@ AC_CHECK_TYPE([intptr_t], [ for tcl_cv_intptr_t in "int" "long" "long long" none; do if test "$tcl_cv_intptr_t" != none; then AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], - [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], + [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], [tcl_ok=yes], [tcl_ok=no]) test "$tcl_ok" = yes && break; fi done]) @@ -415,7 +415,7 @@ AC_CHECK_TYPE([uintptr_t], [ none; do if test "$tcl_cv_uintptr_t" != none; then AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], - [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], + [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], [tcl_ok=yes], [tcl_ok=no]) test "$tcl_ok" = yes && break; fi done]) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index ca58470..66888b9 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -118,7 +118,7 @@ /* * Not all mingw32 versions have this struct. */ -#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(_WIN64) && !defined(HAVE_STRUCT_STAT32I64) +#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(_WIN64) && defined(HAVE_NO_STRUCT_STAT32I64) struct _stat32i64 { dev_t st_dev; ino_t st_ino; |