From bbed95eccee9f7f5940bf4465a16ec6e6efbb84a Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 17 Jan 2012 14:31:32 +0000 Subject: Bump to 2.5.6 --- ChangeLog | 5 +++++ library/http/http.tcl | 2 +- library/http/pkgIndex.tcl | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b49989..6340499 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-17 Don Porter + + * library/http/http.tcl: Bump to 2.5.6. + * library/http/pkgIndex.tcl: + 2012-01-13 Donal K. Fellows * library/http/http.tcl (http::Connect): [Bug 3472316]: Ensure that we diff --git a/library/http/http.tcl b/library/http/http.tcl index 046cdeb..bc8ae7f 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -22,7 +22,7 @@ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories # in Makefiles -package provide http 2.5.5 +package provide http 2.5.6 namespace eval http { variable http diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index cf6a1ff..6c574ef 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.5.5 [list tclPkgSetup $dir http 2.5.5 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.5.6 [list tclPkgSetup $dir http 2.5.6 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] -- cgit v0.12 From 39c48e8c29a2e3955bb342c100298c8a27b31372 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 17 Jan 2012 15:17:21 +0000 Subject: * doc/dict.n (dict with): [Bug 3474512]: Explain better what is going on when a dictionary key and the dictionary variable collide. --- ChangeLog | 5 +++++ doc/dict.n | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index e3086b7..0f19ea4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-01-17 Donal K. Fellows + + * doc/dict.n (dict with): [Bug 3474512]: Explain better what is going + on when a dictionary key and the dictionary variable collide. + 2012-01-17 Don Porter * library/http/http.tcl: Bump to version 2.7.8 diff --git a/doc/dict.n b/doc/dict.n index c54a990..28c4f7c 100644 --- a/doc/dict.n +++ b/doc/dict.n @@ -227,6 +227,15 @@ exist after the command finishes (unless explicitly \fBunset\fR). Note that the mapping of values to variables does not use traces; changes to the \fIdictionaryVariable\fR's contents only happen when \fIbody\fR terminates. +.PP +If the \fIdictionaryVariable\fR contains a value that is not a dictionary at +the point when the \fIbody\fR terminates (which can easily happen if the name +is the same as any of the keys in dictionary) then an error occurs at that +point. This command is thus not recommended for use when the keys in the +dictionary are expected to clash with the \fIdictionaryVariable\fR name +itself. Where the contained key does map to a dictionary, the net effect is to +combine that inner dictionary into the outer dictionary; see the +\fBEXAMPLES\fR below for an illustration of this. .RE .SH "DICTIONARY VALUES" .PP @@ -364,6 +373,16 @@ sumDictionary myDict puts "dictionary is now \\"$myDict\\"" # prints: \fIdictionary is now "a {total 6} b {total 15}"\fR .CE +.PP +When \fBdict with\fR is used with a key that clashes with the name of the +dictionary variable: +.PP +.CS +set foo {foo {a b} bar 2 baz 3} +\fBdict with\fR foo {} +puts $foo +# prints: \fIa b foo {a b} bar 2 baz 3\fR +.CE .SH "SEE ALSO" append(n), array(n), foreach(n), incr(n), list(n), lappend(n), set(n) .SH KEYWORDS -- cgit v0.12 From 868168e18953894ec72ea898ff4d2f518283184e Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 19 Jan 2012 20:46:04 +0000 Subject: 3475667 Prevent buffer read overflow. Thanks to "sebres" for the report and fix. --- ChangeLog | 7 ++++++- generic/tclCmdMZ.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6340499..2c6e34a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2011-01-17 Don Porter +2012-01-19 Don Porter + + * generic/tclCmdMZ.c: [Bug 3475667] Prevent buffer read overflow. + Thanks to "sebres" for the report and fix. + +2012-01-17 Don Porter * library/http/http.tcl: Bump to 2.5.6. * library/http/pkgIndex.tcl: diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index ccf3bc6..27e4055 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -378,7 +378,7 @@ Tcl_RegexpObjCmd(dummy, interp, objc, objv) while (1) { match = Tcl_RegExpExecObj(interp, regExpr, objPtr, offset /* offset */, numMatchesSaved, eflags - | ((offset > 0 && + | ((offset > 0 && offset < stringLength && (Tcl_GetUniChar(objPtr,offset-1) != (Tcl_UniChar)'\n')) ? TCL_REG_NOTBOL : 0)); -- cgit v0.12 From 11fcad9b1df2c2cf7d5ada8feb565c97b9777fef Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 19 Jan 2012 21:22:56 +0000 Subject: [Bug-3474726] minGW Tcl_StatBuf not defined correctly in tcl.h --- ChangeLog | 9 +++++ generic/tcl.h | 2 +- generic/tclFCmd.c | 5 +++ generic/tclTest.c | 5 +++ win/configure | 100 ++++++++++++++++-------------------------------------- win/configure.in | 20 ----------- win/tclWinPort.h | 10 ++---- 7 files changed, 51 insertions(+), 100 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c6e34a..e2b3d47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-01-19 Jan Nijtmans + + * generic/tcl.h: [Bug-3474726]: Eliminate detection of struct + * generic/tclWinPort.h: _stat32i64, just use _stati64 in combination + * generic/tclFCmd.c: with _USE_32BIT_TIME_T, which is the same then. + * generic/tclTest.c: Only keep _stat32i64 usage for cygwin, so it + * win/configure.in: will not conflict with cygwin's own struct stat. + * win/configure: + 2012-01-19 Don Porter * generic/tclCmdMZ.c: [Bug 3475667] Prevent buffer read overflow. diff --git a/generic/tcl.h b/generic/tcl.h index ec64cac..b9355da 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -381,7 +381,7 @@ typedef struct stati64 Tcl_StatBuf; # else /* __BORLANDC__ */ # if defined(_WIN64) typedef struct __stat64 Tcl_StatBuf; -# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) +# elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) typedef struct _stati64 Tcl_StatBuf; # else typedef struct _stat32i64 Tcl_StatBuf; diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 1f73cf3..6113cf7 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -10,6 +10,11 @@ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#ifndef _WIN64 +/* See [Bug 2935503]: file mtime sets wrong time */ +# define _USE_32BIT_TIME_T +#endif + #include #include "tclInt.h" #include "tclPort.h" diff --git a/generic/tclTest.c b/generic/tclTest.c index e870236..194f110 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -15,6 +15,11 @@ * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ +#ifndef _WIN64 +/* See [Bug 2935503]: file mtime sets wrong time */ +# define _USE_32BIT_TIME_T +#endif + #define TCL_TEST #include #include "tclInt.h" diff --git a/win/configure b/win/configure index 1fe4dde..57bc8e6 100755 --- a/win/configure +++ b/win/configure @@ -1263,60 +1263,18 @@ EOF fi -# Check to see if struct _stat32i64 exists in mingw's sys/stat.h - -echo $ac_n "checking if struct _stat32i64 missing""... $ac_c" 1>&6 -echo "configure:1270: checking if struct _stat32i64 missing" >&5 -if eval "test \"`echo '$''{'tcl_struct_stat32i64'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include - -int main() { - - struct _stat32i64 foo; - -; return 0; } -EOF -if { (eval echo configure:1287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - tcl_struct_stat32i64=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - tcl_struct_stat32i64=yes -fi -rm -f conftest* - -fi - -echo "$ac_t""$tcl_struct_stat32i64" 1>&6 -if test "$tcl_struct_stat32i64" = "yes" ; then - cat >> confdefs.h <<\EOF -#define HAVE_NO_STRUCT_STAT32I64 1 -EOF - -fi - - #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1314: checking for object suffix" >&5 +echo "configure:1272: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1334,19 +1292,19 @@ OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1338: checking for mingw32 environment" >&5 +echo "configure:1296: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1365,7 +1323,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1369: checking for executable suffix" >&5 +echo "configure:1327: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1375,7 +1333,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1402,7 +1360,7 @@ ac_exeext=$EXEEXT echo $ac_n "checking for building with threads""... $ac_c" 1>&6 -echo "configure:1406: checking for building with threads" >&5 +echo "configure:1364: checking for building with threads" >&5 # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" @@ -1439,7 +1397,7 @@ EOF echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1443: checking how to build libraries" >&5 +echo "configure:1401: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1480,7 +1438,7 @@ EOF # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1484: checking if 64bit support is requested" >&5 +echo "configure:1442: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1494,7 +1452,7 @@ fi # Cross-compiling options for Windows/CE builds echo $ac_n "checking if Windows/CE build is requested""... $ac_c" 1>&6 -echo "configure:1498: checking if Windows/CE build is requested" >&5 +echo "configure:1456: checking if Windows/CE build is requested" >&5 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" @@ -1506,7 +1464,7 @@ fi echo "$ac_t""$doWince" 1>&6 echo $ac_n "checking for Windows/CE celib directory""... $ac_c" 1>&6 -echo "configure:1510: checking for Windows/CE celib directory" >&5 +echo "configure:1468: checking for Windows/CE celib directory" >&5 # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" @@ -1523,7 +1481,7 @@ fi # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1527: checking for $ac_word" >&5 +echo "configure:1485: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1571,9 +1529,9 @@ fi echo "END" >> $conftest echo $ac_n "checking for Windows native path bug in windres""... $ac_c" 1>&6 -echo "configure:1575: checking for Windows native path bug in windres" >&5 +echo "configure:1533: checking for Windows native path bug in windres" >&5 cyg_conftest=`$CYGPATH $conftest` - if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then + if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 @@ -1592,7 +1550,7 @@ echo "configure:1575: checking for Windows native path bug in windres" >&5 # set various compiler flags depending on whether we are using gcc or cl echo $ac_n "checking compiler flags""... $ac_c" 1>&6 -echo "configure:1596: checking compiler flags" >&5 +echo "configure:1554: checking compiler flags" >&5 if test "${GCC}" = "yes" ; then SHLIB_LD="" SHLIB_LD_LIBS="" @@ -1706,7 +1664,7 @@ echo "configure:1596: checking compiler flags" >&5 ;; *) cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_win_64bit=no else @@ -1970,7 +1928,7 @@ EOF echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:1974: checking for build with symbols" >&5 +echo "configure:1932: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -2030,7 +1988,7 @@ TCL_DBGX=${DBGX} #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2034: checking how to run the C preprocessor" >&5 +echo "configure:1992: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2045,13 +2003,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2062,13 +2020,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2079,13 +2037,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2111,17 +2069,17 @@ echo "$ac_t""$CPP" 1>&6 ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:2115: checking for errno.h" >&5 +echo "configure:2073: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* diff --git a/win/configure.in b/win/configure.in index 47b6a4f..3ac39c3 100644 --- a/win/configure.in +++ b/win/configure.in @@ -240,26 +240,6 @@ if test "$tcl_cv_cast_to_union" = "yes"; then [Defined when compiler supports casting to union type.]) fi -# Check to see if struct _stat32i64 exists in mingw's sys/stat.h - -AC_CACHE_CHECK(if struct _stat32i64 missing, - tcl_struct_stat32i64, -AC_TRY_COMPILE([ -#include -#include -], -[ - struct _stat32i64 foo; -], - tcl_struct_stat32i64=no, - tcl_struct_stat32i64=yes) -) -if test "$tcl_struct_stat32i64" = "yes" ; then - AC_DEFINE(HAVE_NO_STRUCT_STAT32I64, 1, - [Defined when sys/stat.h is missing struct _stat32i64]) -fi - - #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 5f9e018..377aea3 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -93,9 +93,9 @@ #define ENOTSUP -1030507 /* - * Not all mingw32 versions have this struct. + * cygwin does not have this struct. */ -#if !defined(__BORLANDC__) && !defined(_MSC_VER) && !defined(_WIN64) && defined(HAVE_NO_STRUCT_STAT32I64) +#ifdef __CYGWIN__ struct _stat32i64 { dev_t st_dev; ino_t st_ino; @@ -105,15 +105,9 @@ short st_gid; dev_t st_rdev; __int64 st_size; -#ifdef __CYGWIN__ struct {long tv_sec;} st_atim; struct {long tv_sec;} st_mtim; struct {long tv_sec;} st_ctim; -#else - long st_atime; - long st_mtime; - long st_ctime; -#endif }; #endif -- cgit v0.12