diff options
author | dgp <dgp@users.sourceforge.net> | 2008-03-26 20:08:50 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-03-26 20:08:50 (GMT) |
commit | 7d09862213dc5b81ab51ab699129f8dc0add0693 (patch) | |
tree | d14af382e18467566d4258f846b4b551a3192987 | |
parent | bf423bcae3ba7be2e916498f9f50ebb1e903d13a (diff) | |
download | tcl-7d09862213dc5b81ab51ab699129f8dc0add0693.zip tcl-7d09862213dc5b81ab51ab699129f8dc0add0693.tar.gz tcl-7d09862213dc5b81ab51ab699129f8dc0add0693.tar.bz2 |
merge updates from HEAD
-rw-r--r-- | ChangeLog | 226 | ||||
-rw-r--r-- | changes | 18 | ||||
-rw-r--r-- | doc/CrtTrace.3 | 4 | ||||
-rw-r--r-- | doc/GetTime.3 | 2 | ||||
-rw-r--r-- | doc/lappend.n | 4 | ||||
-rw-r--r-- | doc/lindex.n | 4 | ||||
-rw-r--r-- | doc/linsert.n | 4 | ||||
-rw-r--r-- | doc/list.n | 4 | ||||
-rw-r--r-- | doc/llength.n | 4 | ||||
-rw-r--r-- | doc/lrange.n | 4 | ||||
-rw-r--r-- | doc/lreplace.n | 39 | ||||
-rw-r--r-- | doc/lsearch.n | 4 | ||||
-rwxr-xr-x | doc/lset.n | 4 | ||||
-rw-r--r-- | doc/lsort.n | 4 | ||||
-rw-r--r-- | doc/platform.n | 4 | ||||
-rw-r--r-- | doc/platform_shell.n | 4 | ||||
-rw-r--r-- | doc/refchan.n | 4 | ||||
-rw-r--r-- | doc/switch.n | 11 | ||||
-rw-r--r-- | doc/unload.n | 22 | ||||
-rw-r--r-- | generic/tcl.decls | 9 | ||||
-rw-r--r-- | generic/tcl.h | 46 | ||||
-rw-r--r-- | generic/tclBasic.c | 13 | ||||
-rw-r--r-- | generic/tclBinary.c | 6 | ||||
-rw-r--r-- | generic/tclCmdAH.c | 4 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 7 | ||||
-rw-r--r-- | generic/tclCompCmds.c | 9 | ||||
-rw-r--r-- | generic/tclExecute.c | 18 | ||||
-rw-r--r-- | generic/tclTest.c | 6 | ||||
-rwxr-xr-x | generic/tclThreadAlloc.c | 31 | ||||
-rw-r--r-- | library/tm.tcl | 9 | ||||
-rw-r--r-- | tests/binary.test | 14 | ||||
-rw-r--r-- | tests/dict.test | 9 | ||||
-rw-r--r-- | tests/foreach.test | 4 | ||||
-rw-r--r-- | tests/reg.test | 5 | ||||
-rw-r--r-- | tests/switch.test | 108 | ||||
-rw-r--r-- | unix/tclUnixPipe.c | 6 |
36 files changed, 469 insertions, 205 deletions
@@ -1,20 +1,103 @@ +2008-03-26 Don Porter <dgp@users.sourceforge.net> + + * changes: Updated for 8.5.2 release. + +2008-03-24 Pat Thoyts <patthoyts@users.sourceforge.net> + + * generic/tclBinary.c: [Bug 1923966] - crash in binary format + * tests/binary.test: Added tests for the above crash condition. + +2008-03-21 Donal K. Fellows <dkf@users.sf.net> + + * doc/switch.n: Clarified documentation in respect of two-argument + invokation. [Bug 1899962] + + * tests/switch.test: Added more tests of regexp-mode compilation of + the [switch] command. [Bug 1854435] + +2008-03-20 Donal K. Fellows <dkf@users.sf.net> + + * generic/tcl.h, generic/tclThreadAlloc.c: Tidied up the declarations + of Tcl_GetMemoryInfo so that it is always defined. Will panic when + called against a Tcl that was previously built without it at all, + which is OK because that also indicates a serious mismatch between + memory configuration options. + +2008-03-19 Donal K. Fellows <dkf@users.sf.net> + + * generic/tcl.h, generic/tclThreadAlloc.c (Tcl_GetMemoryInfo): Make + sure this function is available when direct linking. [Bug 1868171] + + * tests/reg.test (reg-33.14): Marked nonPortable because some + environments have small default stack sizes. [Bug 1905562] + +2008-03-18 Andreas Kupries <andreask@activestate.com> + + * library/tm.tcl (::tcl::tm::UnknownHandler): Changed 'source' to + 'source -encoding utf-8'. This fixes a portability problem of Tcl + Modules pointed out by Don Porter. By using plain 'source' we were at + the mercy of 'encoding system', making modules less portable than they + could be. The exact scenario: A writes a TM in some weird encoding + which is A's system encoding, distributes it, and somewhere else it + cannot be read/used because the system encoding is different. Forcing + the use of utf-8 makes the module portable. + + ***INCOMPATIBILITY*** for all Tcl Modules already written in non-utf-8 + compatible encodings. + +2008-03-18 Don Porter <dgp@users.sourceforge.net> + + * generic/tclExecute.c: Patch from Miguel Sofer to correct the + alignment of memory allocated by GrowEvaluationStack(). [Bug 1914503] + +2008-03-18 Andreas Kupries <andreask@activestate.com> + + * library/tm.tcl (::tcl::tm::Defaults): Modified handling of + environment variables. See [Bug 1914604]. Solution slightly different + than proposed in the report. Using the underscored form TCLX_y_TM_PATH + even if TCLX.y_TM_PATH exists. Also using a loop to cut prevent code + replication. + +2008-03-16 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclCompCmds.c (TclCompileDictForCmd): Correct the handling + of stack space calculation (the jump pattern used was confusing the + simple-minded code doing the calculations). [Bug 1903325] + + * doc/lreplace.n: Clarified documentation of what happens with + negative indices. [Bug 1905809] Added example, tidied up formatting. + +2008-03-14 Don Porter <dgp@users.sourceforge.net> + + * generic/tclBasic.c (OldMathFuncProc): Same workaround protection + from bad TclStackAlloc() alignment. Thanks George Peter Staplin. + + * generic/tclCmdIL.c (Tcl_LsortObjCmd): Use ckalloc() to allocate + SortElement arrays instead of TclStackAlloc() which isn't getting + alignment right. Workaround for [Bug 1914503]. + +2008-03-14 Reinhard Max <max@suse.de> + + * generic/tclTest.c: Ignore the return value of write() when we are + * unix/tclUnixPipe.c: about to exit anyways. + 2008-03-13 Daniel Steffen <das@users.sourceforge.net> - * unix/configure.in: use backslash-quoting instead of double-quoting - * unix/tcl.m4: for lib paths in tclConfig.sh [Bug 1913622]. + * unix/configure.in: Use backslash-quoting instead of double-quoting + * unix/tcl.m4: for lib paths in tclConfig.sh. [Bug 1913622] * unix/configure: autoconf-2.59 2008-03-13 Don Porter <dgp@users.sourceforge.net> * changes: Updated for 8.5.2 release. - * generic/tclStrToD.c: Resolve identifier conflict over "pow10" - with libm in Cygwin and DJGPP. Thanks to Gordon Schumacher and - Philip Moore. [Patch 1800636] + * generic/tclStrToD.c: Resolve identifier conflict over "pow10" with + libm in Cygwin and DJGPP. Thanks to Gordon Schumacher and Philip + Moore. [Patch 1800636] 2008-03-12 Daniel Steffen <das@users.sourceforge.net> - * macosx/Tcl.xcodeproj/project.pbxproj: add support for Xcode 3.1 + * macosx/Tcl.xcodeproj/project.pbxproj: Add support for Xcode 3.1 * macosx/Tcl.xcodeproj/default.pbxuser: CODE_SIGN_IDENTITY and * macosx/Tcl-Common.xcconfig: 'xcodebuild install'. @@ -29,41 +112,41 @@ * library/http/http.tcl (http::geturl): control of selected socket * library/http/pkgIndex.tcl: interface. [Bug 559898] * doc/http.n, tests/http.test: Added -keepalive and - -protocol 1.1 with chunked transfer encoding support. [Bug - 1063703, 1470377, 219225] (default keepalive is 0) + -protocol 1.1 with chunked transfer encoding support. [Bug 1063703, + 1470377, 219225] (default keepalive is 0) Added ability to override Host in -headers. [Bug 928154] Added -strict option to control URL validation on per-call basis. [Bug 1560506] 2008-03-11 Jeff Hobbs <jeffh@ActiveState.com> - * library/http/http.tcl (http::geturl): add -method option to support + * library/http/http.tcl (http::geturl): Add -method option to support * tests/http.test (http-3.1): http PUT and DELETE requests. * doc/http.n: [Bug 1599901, 862554] - * library/http/http.tcl: whitespace changes, code cleanup. Allow - http to be re-sourced without overwriting http state. + * library/http/http.tcl: Whitespace changes, code cleanup. Allow http + to be re-sourced without overwriting http state. 2008-03-11 Daniel Steffen <das@users.sourceforge.net> - * generic/tclEncoding.c (LoadEscapeEncoding): avoid leaking escape + * generic/tclEncoding.c (LoadEscapeEncoding): Avoid leaking escape sub-encodings, fixes encoding-11.1 failing after iso2022-jp loaded. [Bug 1893053] - * macosx/tclMacOSXNotify.c: avoid using CoreFoundation after fork() on + * macosx/tclMacOSXNotify.c: Avoid using CoreFoundation after fork() on Darwin 9 even when TclpCreateProcess() uses vfork(). - * macosx/Tcl.xcodeproj/project.pbxproj: add support for Xcode 3.1 and + * macosx/Tcl.xcodeproj/project.pbxproj: Add support for Xcode 3.1 and * macosx/Tcl.xcodeproj/default.pbxuser: targets for building with * macosx/Tcl-Common.xcconfig: gcc-4.2 and llvm-gcc-4.2. - * unix/tclUnixPort.h: workaround vfork() problems + * unix/tclUnixPort.h: Workaround vfork() problems in llvm-gcc-4.2.1 -O4 build. - * unix/tclUnixPort.h: move MODULE_SCOPE compat define + * unix/tclUnixPort.h: Move MODULE_SCOPE compat define to top [Bug 1911102]. - * macosx/GNUmakefile: fix quoting to allow paths to + * macosx/GNUmakefile: Fix quoting to allow paths to * macosx/Tcl-Common.xcconfig: ${builddir} and ${INSTALL_ROOT} * unix/Makefile.in: to contain spaces. * unix/configure.in: @@ -73,23 +156,23 @@ * unix/configure: autoconf-2.59 - * unix/Makefile.in (install-strip): strip non-global symbols from + * unix/Makefile.in (install-strip): Strip non-global symbols from dynamic library. - * unix/tclUnixNotfy.c: fix warning. + * unix/tclUnixNotfy.c: Fix warning. - * tests/exec.test (exec-9.7): reduce timing sensitivity + * tests/exec.test (exec-9.7): Reduce timing sensitivity * tests/socket.test (socket-2.11): (esp. on multi-proc machines). - * tests/fCmd.test (fCmd-9.4): skip on Darwin 9 (xfail). + * tests/fCmd.test (fCmd-9.4): Skip on Darwin 9 (xfail). 2008-03-11 Miguel Sofer <msofer@users.sf.net> * generic/tclVar.c (TclDeleteNamespaceVars): - * tests/var.test (var-8.2): unset traces on vars should be called - with a FQ named during namespace deletion. This was causing - infinite loops when unset traces recreated the var, as reported by - Julian Noble on [Bug 1911919]. + * tests/var.test (var-8.2): Unset traces on vars should be called with + a FQ named during namespace deletion. This was causing infinite loops + when unset traces recreated the var, as reported by Julian Noble. [Bug + 1911919] 2008-03-10 Don Porter <dgp@users.sourceforge.net> @@ -100,32 +183,31 @@ * generic/tclEvent.c (TclDefaultBgErrorHandlerObjCmd): Added error * tests/event.test (event-5.*): checking to protect against callers - passing invalid return options dictionaries. [Bug 1901113] + passing invalid return options dictionaries. [Bug 1901113] * generic/tclBasic.c (ExprAbsFunc): Revised so that the abs() * tests/expr.test: function and the [::tcl::mathfunc::abs] - command do not return the value of -0, or equivalent values with - more alarming string reps like -1e-350. [Bug 1893815]. + command do not return the value of -0, or equivalent values with more + alarming string reps like -1e-350. [Bug 1893815] 2008-03-07 Andreas Kupries <andreask@activestate.com> - * generic/tclResult.c (ReleaseKeys): Workaround for [Bug - 1904907]. Reset the return option keys to NULL to allow full - re-initialization by GetKeys(). This introduces a memory leak - for the key objects, but gets us around a crash in the - finalization of reflected channels when handling returns, either - at compile- or runtime. In both cases we access the keys after - they have been released by their thread exit handler. A proper - fix is entangled with the untangling of the finalization - ordering and attendant issues. For now we choose the lesser - evil. + * generic/tclResult.c (ReleaseKeys): Workaround for [Bug 1904907]. + Reset the return option keys to NULL to allow full re-initialization + by GetKeys(). This introduces a memory leak for the key objects, but + gets us around a crash in the finalization of reflected channels when + handling returns, either at compile- or runtime. In both cases we + access the keys after they have been released by their thread exit + handler. A proper fix is entangled with the untangling of the + finalization ordering and attendant issues. For now we choose the + lesser evil. 2008-03-07 Don Porter <dgp@users.sourceforge.net> * generic/tclExecute.c (Tcl_ExprObj): Revised expression bytecode - compiling so that bytecodes invalid due to changing context or due - to the difference between expressions and scripts are not reused. - [Bug 1899164]. + compiling so that bytecodes invalid due to changing context or due to + the difference between expressions and scripts are not reused. [Bug + 1899164] * generic/tclCmdAH.c: Revised direct evaluation implementation of [expr] so that [expr $e] caches compiled bytecodes for the expression @@ -154,7 +236,7 @@ 2008-03-02 Miguel Sofer <msofer@users.sf.net> * generic/tclNamesp.c (GetNamespaceFromObj): - * tests/interp.test (interp-28.2): spoil the intrep of an nsNameType + * tests/interp.test (interp-28.2): Spoil the intrep of an nsNameType obj when the reference crosses interpreter boundaries. 2008-02-29 Don Porter <dgp@users.sourceforge.net> @@ -316,20 +398,20 @@ 2008-02-04 Miguel Sofer <msofer@users.sf.net> - * generic/tclExecute.c (INST_CONCAT1): fix optimisation for in-place + * generic/tclExecute.c (INST_CONCAT1): Fix optimisation for in-place concatenation (was going over String type) 2008-02-02 Daniel Steffen <das@users.sourceforge.net> - * unix/configure.in (Darwin): correct Info.plist year substitution in + * unix/configure.in (Darwin): Correct Info.plist year substitution in non-framework builds. * unix/configure: autoconf-2.59 2008-01-30 Miguel Sofer <msofer@users.sf.net> - * generic/tclInterp.c (Tcl_GetAlias): fix for [Bug 1882373], thanks go - to an00na + * generic/tclInterp.c (Tcl_GetAlias): Fix for [Bug 1882373], thanks go + to an00na. 2008-01-30 Donal K. Fellows <donal.k.fellows@man.ac.uk> @@ -377,14 +459,14 @@ 2008-01-22 Miguel Sofer <msofer@users.sf.net> * generic/tclCmdIl.c (Tcl_LreverseObjCmd): - * tests/cmdIL.test (cmdIL-7.7): fix crash on reversing an empty list. + * tests/cmdIL.test (cmdIL-7.7): Fix crash on reversing an empty list. [Bug 1876793] 2008-01-20 Jeff Hobbs <jeffh@ActiveState.com> - * unix/README: minor typo fixes [Bug 1853072] + * unix/README: Minor typo fixes [Bug 1853072] - * generic/tclIO.c (TclGetsObjBinary): operate on topmost channel. + * generic/tclIO.c (TclGetsObjBinary): Operate on topmost channel. [Bug 1869405] (Ficicchia) 2008-01-17 Don Porter <dgp@users.sourceforge.net> @@ -395,7 +477,7 @@ 2008-01-15 Miguel Sofer <msofer@users.sf.net> - * generic/tclCompExpr.c: add an 'optimize' argument to + * generic/tclCompExpr.c: Add an 'optimize' argument to * generic/tclCompile.c: TclCompileExpr() to profit from better * generic/tclCompile.h: literal management according to usage. * generic/tclExecute.c: @@ -405,7 +487,7 @@ * generic/tclExecute.c: * tests/compExpr.test: - * doc/proc.n: changed wording for access to non-local variables; added + * doc/proc.n: Changed wording for access to non-local variables; added mention to [namespace upvar]. Lame attempt at dealing with documentation. [Bug 1872708] @@ -417,15 +499,15 @@ 2008-01-13 Jeff Hobbs <jeffh@ActiveState.com> - * win/tclWinSerial.c (SerialCloseProc, TclWinOpenSerialChannel): use + * win/tclWinSerial.c (SerialCloseProc, TclWinOpenSerialChannel): Use critical section for read & write side. [Bug 1353846] (newman) 2008-01-11 Miguel Sofer <msofer@users.sf.net> - * unix/tclUnixThrd.c (TclpThreadGetStackSize): restore stack checking + * unix/tclUnixThrd.c (TclpThreadGetStackSize): Restore stack checking functionality in freebsd. [Bug 1850424] - * unix/tclUnixThrd.c (TclpThreadGetStackSize): fix for crash in + * unix/tclUnixThrd.c (TclpThreadGetStackSize): Fix for crash in freebsd. [Bug 1860425] 2008-01-10 Don Porter <dgp@users.sourceforge.net> @@ -436,11 +518,11 @@ 2008-01-09 George Peter Staplin <georgeps@xmission.com> - * doc/vwait.n: add a missing be to fix a typo. + * doc/vwait.n: Add a missing be to fix a typo. 2008-01-04 Jeff Hobbs <jeffh@ActiveState.com> - * tools/tcltk-man2html.tcl (make-man-pages): make man page title use + * tools/tcltk-man2html.tcl (make-man-pages): Make man page title use more specific info on lhs to improve tabbed browser view titles. 2008-01-02 Donal K. Fellows <dkf@users.sf.net> @@ -468,7 +550,7 @@ 2007-12-26 Miguel Sofer <msofer@users.sf.net> - * generic/tclCmdIL.c: more [lsort] data handling streamlines. The + * generic/tclCmdIL.c: More [lsort] data handling streamlines. The function MergeSort is gone, essentially inlined into Tcl_LsortObjCmd. It is not a straight inlining, two loops over all lists elements where merged in the process: the linked list elements are now built and @@ -476,7 +558,7 @@ 2007-12-25 Miguel Sofer <msofer@users.sf.net> - * generic/tclCmdIL.c: more [lsort] data handling streamlines. Extra + * generic/tclCmdIL.c: More [lsort] data handling streamlines. Extra mem reqs of latest patches removed, restored to previous mem profile. Improved -unique handling, now eliminating repeated elems immediately instead of marking them to avoid reinsertion at the end. @@ -489,16 +571,16 @@ 2007-12-21 Miguel Sofer <msofer@users.sf.net> - * generic/tclCmdIL.c: speed patch for lsort [Patch 1856994]. + * generic/tclCmdIL.c: Speed patch for lsort [Patch 1856994]. 2007-12-21 Miguel Sofer <msofer@users.sf.net> - * generic/tclCmdIL.c (Tcl_LsortObjCmd, Tcl_LsearchObjCmd): avoid + * generic/tclCmdIL.c (Tcl_LsortObjCmd, Tcl_LsearchObjCmd): Avoid calling SelectObjFromSublist when there are no sublists. 2007-12-21 Miguel Sofer <msofer@users.sf.net> - * generic/tclCmdIL.c (Tcl_LsortObjCmd): preallocate a listObj of + * generic/tclCmdIL.c (Tcl_LsortObjCmd): Preallocate a listObj of sufficient length for the sorted list instead of growing it. Second commit replaces calls to Tcl_ListObjAppenElement with direct access to the internal rep. @@ -1374,9 +1456,9 @@ 2007-10-17 Kevin B. Kenny <kennykb@acm.org> * generic/tclCompExpr.c: Moved a misplaced declaration that blocked - compilation on VC++. + compilation on VC++. * generic/tclExecute.c: Silenced several VC++ compiler warnings about - converting 'long' to 'unsigned short'. + converting 'long' to 'unsigned short'. 2007-10-16 David Gravereaux <davygrvy@pobox.com> @@ -1434,7 +1516,7 @@ * win/makefile.vc: Mine all version information from headers. * win/rules.vc: Sync tcl and tk and bring extension versions * win/nmakehlp.c: closer together. Try and avoid using tclsh to do - substitutions as we may cross compile. + substitutions as we may cross compile. * win/coffbase.txt: Added offsets for snack dlls. 2007-10-11 David Gravereaux <davygrvy@pobox.com> @@ -1536,7 +1618,7 @@ * win/makefile.vc: Add crt flags for tclStubLib now it uses C-library functions. -2007-09-17 Joe English <jenglish@users.sourceforge.net> +2007-09-17 Joe English <jenglish@users.sourceforge.net> * tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable' to build shared libraries on current NetBSDs. [Bug 1749251] @@ -1577,7 +1659,7 @@ 2007-09-14 Daniel Steffen <das@users.sourceforge.net> - * generic/tclDTrace.d (new file): add DTrace provider for Tcl; allows + * generic/tclDTrace.d (new file): Add DTrace provider for Tcl; allows * generic/tclCompile.h: tracing of proc and command entry & * generic/tclBasic.c: return, bytecode execution, object * generic/tclExecute.c: allocation and more; with @@ -1588,11 +1670,11 @@ * unix/configure.in: enable if DTrace is present). [Patch 1793984] - * macosx/GNUmakefile: enable DTrace support. + * macosx/GNUmakefile: Enable DTrace support. * macosx/Tcl-Common.xcconfig: * macosx/Tcl.xcodeproj/project.pbxproj: - * generic/tclCmdIL.c: factor out core of InfoFrameCmd() into + * generic/tclCmdIL.c: Factor out core of InfoFrameCmd() into internal TclInfoFrame() for use by DTrace probes. @@ -2044,8 +2126,8 @@ non-resolved case, as the function is never called in that case. Renamed the function to InitResolvedLocals to calrify the point. - * generic/tclInt.decls: Exporting via stubs to help xotcl adapt to - * generic/tclInt.h: VarReform. + * generic/tclInt.decls: Exporting via stubs to help xotcl adapt to + * generic/tclInt.h: VarReform. * generic/tclIntDecls.h: * generic/tclStubInit.c: @@ -2732,10 +2814,10 @@ [core-stabilizer-branch] - * unix/configure: autoconf-2.59 (FC6 fork) + * unix/configure: autoconf-2.59 (FC6 fork) * win/configure: - * README: Bump version number to 8.5b1 + * README: Bump version number to 8.5b1 * generic/tcl.h: * library/init.tcl: * tools/tcl.wse.in: @@ -1,6 +1,6 @@ Recent user-visible changes to Tcl: -RCS: @(#) $Id: changes,v 1.116.2.11 2008/03/13 20:29:36 dgp Exp $ +RCS: @(#) $Id: changes,v 1.116.2.12 2008/03/26 20:08:52 dgp Exp $ 1. No more [command1] [command2] construct for grouping multiple commands on a single command line. @@ -7171,4 +7171,18 @@ and Tcl_AddObjToErrorInfo() (spjuth,porter) 2008-03-12 (new feature) some HTTP 1.1 support in http (and more!) (hobbs) => http 2.7 ---- Released 8.5.2, March 18, 2008 --- See ChangeLog for details --- +2008-03-13 (enhancement) support space in INSTALL_ROOT or $builddir (steffen) + +2008-03-16 (bug fix)[1903325] bytecode stack space prediction crash (fellows) + +2008-03-18 (bug fix)[1914604] Tcl Modules: encoding fixed to utf-8; environment +variables without "." added to customization hooks (kupries) + *** POTENTIAL INCOMPATIBILITY *** + +2008-03-18 (bug fix)[1914503] alignment of TclStackAlloc() return (sofer)\ + +2008-03-20 (bug fix)[1868171] expose Tcl_GetMemoryInfo (for AOLserver) (fellows) + +2008-03-24 (bug fix)[1923966] crash in [binary format x0s] (thoyts) + +--- Released 8.5.2, March 28, 2008 --- See ChangeLog for details --- diff --git a/doc/CrtTrace.3 b/doc/CrtTrace.3 index 32cce3d..0194a5b 100644 --- a/doc/CrtTrace.3 +++ b/doc/CrtTrace.3 @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1989-1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2002 by Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2002 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtTrace.3,v 1.10.12.1 2007/11/01 16:25:45 dgp Exp $ +'\" RCS: @(#) $Id: CrtTrace.3,v 1.10.12.2 2008/03/26 20:08:52 dgp Exp $ '\" .so man.macros .TH Tcl_CreateTrace 3 "" Tcl "Tcl Library Procedures" diff --git a/doc/GetTime.3 b/doc/GetTime.3 index e15d3f3..d932e47 100644 --- a/doc/GetTime.3 +++ b/doc/GetTime.3 @@ -1,5 +1,5 @@ '\" -'\" Copyright (c) 2001 by Kevin B. Kenny. +'\" Copyright (c) 2001 by Kevin B. Kenny <kennykb@acm.org>. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/doc/lappend.n b/doc/lappend.n index 454fd06..0ab476f 100644 --- a/doc/lappend.n +++ b/doc/lappend.n @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lappend.n,v 1.11.8.1 2007/11/01 16:25:49 dgp Exp $ +'\" RCS: @(#) $Id: lappend.n,v 1.11.8.2 2008/03/26 20:08:52 dgp Exp $ '\" .so man.macros .TH lappend n "" Tcl "Tcl Built-In Commands" diff --git a/doc/lindex.n b/doc/lindex.n index c88cf91..f4aff5c 100644 --- a/doc/lindex.n +++ b/doc/lindex.n @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lindex.n,v 1.12.2.1 2007/11/02 14:49:14 dgp Exp $ +'\" RCS: @(#) $Id: lindex.n,v 1.12.2.2 2008/03/26 20:08:53 dgp Exp $ '\" .so man.macros .TH lindex n 8.4 Tcl "Tcl Built-In Commands" diff --git a/doc/linsert.n b/doc/linsert.n index d6384d2..d5dcffe 100644 --- a/doc/linsert.n +++ b/doc/linsert.n @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: linsert.n,v 1.13 2005/05/10 18:34:00 kennykb Exp $ +'\" RCS: @(#) $Id: linsert.n,v 1.13.8.1 2008/03/26 20:08:53 dgp Exp $ '\" .so man.macros .TH linsert n 8.2 Tcl "Tcl Built-In Commands" @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: list.n,v 1.10 2004/10/27 12:53:22 dkf Exp $ +'\" RCS: @(#) $Id: list.n,v 1.10.12.1 2008/03/26 20:08:53 dgp Exp $ '\" .so man.macros .TH list n "" Tcl "Tcl Built-In Commands" diff --git a/doc/llength.n b/doc/llength.n index 201d50e..a88dd8c 100644 --- a/doc/llength.n +++ b/doc/llength.n @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: llength.n,v 1.10 2005/05/10 18:34:00 kennykb Exp $ +'\" RCS: @(#) $Id: llength.n,v 1.10.8.1 2008/03/26 20:08:53 dgp Exp $ '\" .so man.macros .TH llength n "" Tcl "Tcl Built-In Commands" diff --git a/doc/lrange.n b/doc/lrange.n index 72ddce4..ac2843b 100644 --- a/doc/lrange.n +++ b/doc/lrange.n @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lrange.n,v 1.12.8.1 2007/11/01 16:25:49 dgp Exp $ +'\" RCS: @(#) $Id: lrange.n,v 1.12.8.2 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH lrange n 7.4 Tcl "Tcl Built-In Commands" diff --git a/doc/lreplace.n b/doc/lreplace.n index 4c9f8c9..fd90248 100644 --- a/doc/lreplace.n +++ b/doc/lreplace.n @@ -1,12 +1,12 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lreplace.n,v 1.13 2005/05/10 18:34:01 kennykb Exp $ +'\" RCS: @(#) $Id: lreplace.n,v 1.13.8.1 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH lreplace n 7.4 Tcl "Tcl Built-In Commands" @@ -17,14 +17,13 @@ lreplace \- Replace elements in a list with new elements .SH SYNOPSIS \fBlreplace \fIlist first last \fR?\fIelement element ...\fR? .BE - .SH DESCRIPTION .PP \fBlreplace\fR returns a new list formed by replacing one or more elements of \fIlist\fR with the \fIelement\fR arguments. .VS 8.5 \fIfirst\fR and \fIlast\fR are index values specifying the first and -last elements of the range to replace. +last elements of the range to replace. The index values \fIfirst\fR and \fIlast\fR are interpreted the same as index values for the command \fBstring index\fR, supporting simple index arithmetic and indices relative to the @@ -33,16 +32,16 @@ end of the list. list, and \fBend\fR refers to the last element of the list. If \fIlist\fR is empty, then \fIfirst\fR and \fIlast\fR are ignored. .VE - -If \fIfirst\fR is less than zero, it is considered to refer to the +.PP +If \fIfirst\fR is less than zero, it is considered to refer to before the first element of the list. For non-empty lists, the element indicated -by \fIfirst\fR must exist. - -If \fIlast\fR is less than zero but greater than \fIfirst\fR, then any -specified elements will be prepended to the list. If \fIlast\fR is -less than \fIfirst\fR then no elements are deleted; the new elements -are simply inserted before \fIfirst\fR. - +by \fIfirst\fR must exist or \fIfirst\fR must indicate before the +start of the list. +.PP +If \fIlast\fR is less than \fIfirst\fR, then any specified elements +will be inserted into the list at the point specified by \fIfirst\fR +with no elements being deleted. +.PP The \fIelement\fR arguments specify zero or more new arguments to be added to the list in place of those that were deleted. Each \fIelement\fR argument will become a separate element of @@ -69,14 +68,20 @@ a b c d e % set var [\fBlreplace\fR $var end end] a b c d .CE - +.PP +A procedure to delete a given element from a list: +.CS +proc lremove {listVariable value} { + upvar 1 $listVariable var + set idx [lsearch -exact $var $value] + set var [\fBlreplace\fR $var $idx $idx] +} +.CE .SH "SEE ALSO" -list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), +list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n), lset(n), lrange(n), lsort(n), .VS 8.5 string(n) .VE - - .SH KEYWORDS element, list, replace diff --git a/doc/lsearch.n b/doc/lsearch.n index 6cf9131..9e69a97 100644 --- a/doc/lsearch.n +++ b/doc/lsearch.n @@ -1,13 +1,13 @@ '\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" Copyright (c) 2003-2004 Donal K. Fellows. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsearch.n,v 1.26.8.3 2007/11/02 14:49:14 dgp Exp $ +'\" RCS: @(#) $Id: lsearch.n,v 1.26.8.4 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH lsearch n 8.5 Tcl "Tcl Built-In Commands" @@ -1,10 +1,10 @@ '\" -'\" Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 by Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lset.n,v 1.9.8.1 2007/11/02 14:49:14 dgp Exp $ +'\" RCS: @(#) $Id: lset.n,v 1.9.8.2 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH lset n 8.4 Tcl "Tcl Built-In Commands" diff --git a/doc/lsort.n b/doc/lsort.n index 1e63181..e712ebd 100644 --- a/doc/lsort.n +++ b/doc/lsort.n @@ -2,12 +2,12 @@ '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. '\" Copyright (c) 1999 Scriptics Corporation -'\" Copyright (c) 2001 Kevin B. Kenny. All rights reserved. +'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lsort.n,v 1.21.8.2 2007/11/01 16:25:49 dgp Exp $ +'\" RCS: @(#) $Id: lsort.n,v 1.21.8.3 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH lsort n 8.5 Tcl "Tcl Built-In Commands" diff --git a/doc/platform.n b/doc/platform.n index 1469c4e..e8bf593 100644 --- a/doc/platform.n +++ b/doc/platform.n @@ -1,10 +1,10 @@ '\" -'\" Copyright (c) 2006 ActiveState Software +'\" Copyright (c) 2006 ActiveState Software Inc '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: platform.n,v 1.1.4.2 2007/11/01 16:25:50 dgp Exp $ +'\" RCS: @(#) $Id: platform.n,v 1.1.4.3 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH "platform" n 1.0.3 platform "Tcl Bundled Packages" diff --git a/doc/platform_shell.n b/doc/platform_shell.n index 9283c06..92f5b54 100644 --- a/doc/platform_shell.n +++ b/doc/platform_shell.n @@ -1,10 +1,10 @@ '\" -'\" Copyright (c) 2006 ActiveState Software +'\" Copyright (c) 2006 ActiveState Software Inc '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: platform_shell.n,v 1.3.4.1 2007/09/04 17:43:47 dgp Exp $ +'\" RCS: @(#) $Id: platform_shell.n,v 1.3.4.2 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH "platform::shell" n 1.1.3 platform::shell "Tcl Bundled Packages" diff --git a/doc/refchan.n b/doc/refchan.n index 38b62dd..7747d40 100644 --- a/doc/refchan.n +++ b/doc/refchan.n @@ -1,10 +1,10 @@ '\" -'\" Copyright (c) 2006 Andreas Kupries +'\" Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net> '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: refchan.n,v 1.5.2.1 2007/11/01 16:25:54 dgp Exp $ +'\" RCS: @(#) $Id: refchan.n,v 1.5.2.2 2008/03/26 20:08:54 dgp Exp $ .so man.macros .TH refchan n 8.5 Tcl "Tcl Built-In Commands" .BS diff --git a/doc/switch.n b/doc/switch.n index 7a6e5de..7620247 100644 --- a/doc/switch.n +++ b/doc/switch.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: switch.n,v 1.10.6.2 2007/12/04 16:55:53 dgp Exp $ +'\" RCS: @(#) $Id: switch.n,v 1.10.6.3 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH switch n 8.5 Tcl "Tcl Built-In Commands" @@ -32,8 +32,13 @@ matches \fIstring\fR and no default is given, then the \fBswitch\fR command returns an empty string. .PP If the initial arguments to \fBswitch\fR start with \fB\-\fR then -they are treated as options. The following options are -currently supported: +they are treated as options +.VS 8.5 +unless there are exactly two arguments to \fBswitch\fR (in which case the +first must the \fIstring\fR and the second must be the +\fIpattern\fR/\fIbody\fR list). +.VE 8.5 +The following options are currently supported: .TP 10 \fB\-exact\fR Use exact matching when comparing \fIstring\fR to a pattern. This diff --git a/doc/unload.n b/doc/unload.n index f9674c3..dd05e4d 100644 --- a/doc/unload.n +++ b/doc/unload.n @@ -1,10 +1,10 @@ '\" -'\" Copyright (c) 2003 George Petasis, petasis@iit.demokritos.gr. +'\" Copyright (c) 2003 George Petasis <petasis@iit.demokritos.gr>. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: unload.n,v 1.9 2007/02/18 18:42:55 dkf Exp $ +'\" RCS: @(#) $Id: unload.n,v 1.9.2.1 2008/03/26 20:08:54 dgp Exp $ '\" .so man.macros .TH unload n 8.5 Tcl "Tcl Built-In Commands" @@ -19,7 +19,6 @@ unload \- Unload machine code .br \fBunload \fR?\fIswitches\fR? \fIfileName packageName interp\fR .BE - .SH DESCRIPTION .PP This command tries to unload shared libraries previously loaded @@ -35,22 +34,26 @@ The \fIinterp\fR argument is the path name of the interpreter from which to unload the package (see the \fBinterp\fR manual entry for details); if \fIinterp\fR is omitted, it defaults to the interpreter in which the \fBunload\fR command was invoked. -.LP +.PP If the initial arguments to \fBunload\fR start with \fB\-\fR then they are treated as switches. The following switches are currently supported: .TP \fB\-nocomplain\fR +. Suppresses all error messages. If this switch is given, \fBunload\fR will never report an error. .TP \fB\-keeplibrary\fR +. This switch will prevent \fBunload\fR from issuing the operating system call that will unload the library from the process. .TP \fB\-\|\-\fR +. Marks the end of switches. The argument following this one will be treated as a \fIfileName\fR even if it starts with a \fB\-\fR. +.SS "UNLOAD OPERATION" .PP When a file containing a shared library is loaded through the \fBload\fR command, Tcl associates two reference counts to the library @@ -84,11 +87,13 @@ procedure. If the unload procedure returns \fBTCL_OK\fR, \fBunload\fR will proce and decrease the proper reference count (depending on the target interpreter type). When both reference counts have reached 0, the library will be detached from the process. +.SS "UNLOAD HOOK PROTOTYPE" .PP The unload procedure must match the following prototype: .CS typedef int Tcl_PackageUnloadProc(Tcl_Interp *\fIinterp\fR, int \fIflags\fR); .CE +.PP The \fIinterp\fR argument identifies the interpreter from which the library is to be unloaded. The unload procedure must return \fBTCL_OK\fR or \fBTCL_ERROR\fR to indicate whether or not it completed @@ -104,10 +109,11 @@ the library is used by other interpreters), library is used only by the target interpreter and the library will be detached from the application as soon as the unload procedure returns, the \fIflags\fR argument will be set to \fBTCL_UNLOAD_DETACH_FROM_PROCESS\fR. +.SS NOTES .PP The \fBunload\fR command cannot unload libraries that are statically linked with the application. -If \fIfileName\fR is an empty string, then \fIpackageName\fR must +If \fIfileName\fR is an empty string, then the \fIpackageName\fR argument must be specified. .PP If \fIpackageName\fR is omitted or specified as an empty string, @@ -125,8 +131,8 @@ module name \fBlast\fR. \fBUnix\fR\0\0\0\0\0 . Not all unix operating systems support library unloading. Under such -an operating system \fBunload\fR returns an error (unless -nocomplain has -been specified). +an operating system \fBunload\fR returns an error (unless \fB\-nocomplain\fR +has been specified). .SH BUGS .PP If the same file is \fBload\fRed by different \fIfileName\fRs, it will @@ -152,9 +158,7 @@ This allows a C code module to be installed temporarily into a long-running Tcl program and then removed again (either because it is no longer needed or because it is being updated with a new version) without having to shut down the overall Tcl process. - .SH "SEE ALSO" info sharedlibextension, load(n), safe(n) - .SH KEYWORDS binary code, unloading, safe interpreter, shared library diff --git a/generic/tcl.decls b/generic/tcl.decls index 4e2e04b..c97bb57 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.126.2.2 2007/12/10 18:32:55 dgp Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.126.2.3 2008/03/26 20:08:54 dgp Exp $ library tcl @@ -2154,11 +2154,14 @@ export { } export { CONST char *TclTomMathInitializeStubs(Tcl_Interp* interp, - CONST char* version, int epoch, int revision + CONST char* version, int epoch, int revision) } export { CONST char *Tcl_PkgInitStubsCheck(Tcl_Interp *interp, CONST char *version, - int exact); + int exact) +} +export { + void Tcl_GetMemoryInfo(Tcl_DString *dsPtr) } # Global variables that need to be exported from the tcl shared library. diff --git a/generic/tcl.h b/generic/tcl.h index 560e135..6205dfc 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tcl.h,v 1.231.2.16 2008/03/07 22:05:02 dgp Exp $ + * RCS: @(#) $Id: tcl.h,v 1.231.2.17 2008/03/26 20:08:55 dgp Exp $ */ #ifndef _TCL @@ -823,10 +823,10 @@ typedef struct Tcl_Namespace { * starts with ::. */ ClientData clientData; /* Arbitrary value associated with this * namespace. */ - Tcl_NamespaceDeleteProc* deleteProc; + Tcl_NamespaceDeleteProc *deleteProc; /* Function invoked when deleting the * namespace to, e.g., free clientData. */ - struct Tcl_Namespace* parentPtr; + struct Tcl_Namespace *parentPtr; /* Points to the namespace that contains this * one. NULL if this is the global * namespace. */ @@ -1337,8 +1337,10 @@ typedef int (Tcl_WaitForEventProc) _ANSI_ARGS_((Tcl_Time *timePtr)); * TIP #233 (Virtualized Time) */ -typedef void (Tcl_GetTimeProc) _ANSI_ARGS_ ((Tcl_Time* timebuf, ClientData clientData)); -typedef void (Tcl_ScaleTimeProc) _ANSI_ARGS_ ((Tcl_Time* timebuf, ClientData clientData)); +typedef void (Tcl_GetTimeProc) _ANSI_ARGS_((Tcl_Time *timebuf, + ClientData clientData)); +typedef void (Tcl_ScaleTimeProc) _ANSI_ARGS_((Tcl_Time *timebuf, + ClientData clientData)); /* * Bits to pass to Tcl_CreateFileHandler and Tcl_CreateChannelHandler to @@ -1584,10 +1586,10 @@ typedef int (Tcl_FSStatProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf)); typedef int (Tcl_FSAccessProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, int mode)); typedef Tcl_Channel (Tcl_FSOpenFileChannelProc) _ANSI_ARGS_(( Tcl_Interp *interp, Tcl_Obj *pathPtr, int mode, int permissions)); -typedef int (Tcl_FSMatchInDirectoryProc) _ANSI_ARGS_((Tcl_Interp* interp, +typedef int (Tcl_FSMatchInDirectoryProc) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *result, Tcl_Obj *pathPtr, CONST char *pattern, Tcl_GlobTypeData * types)); -typedef Tcl_Obj* (Tcl_FSGetCwdProc) _ANSI_ARGS_((Tcl_Interp *interp)); +typedef Tcl_Obj * (Tcl_FSGetCwdProc) _ANSI_ARGS_((Tcl_Interp *interp)); typedef int (Tcl_FSChdirProc) _ANSI_ARGS_((Tcl_Obj *pathPtr)); typedef int (Tcl_FSLstatProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_StatBuf *buf)); @@ -1602,7 +1604,7 @@ typedef int (Tcl_FSRemoveDirectoryProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, typedef int (Tcl_FSRenameFileProc) _ANSI_ARGS_((Tcl_Obj *srcPathPtr, Tcl_Obj *destPathPtr)); typedef void (Tcl_FSUnloadFileProc) _ANSI_ARGS_((Tcl_LoadHandle loadHandle)); -typedef Tcl_Obj* (Tcl_FSListVolumesProc) _ANSI_ARGS_((void)); +typedef Tcl_Obj * (Tcl_FSListVolumesProc) _ANSI_ARGS_((void)); /* We have to declare the utime structure here. */ struct utimbuf; typedef int (Tcl_FSUtimeProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, @@ -1611,25 +1613,25 @@ typedef int (Tcl_FSNormalizePathProc) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *pathPtr, int nextCheckpoint)); typedef int (Tcl_FSFileAttrsGetProc) _ANSI_ARGS_((Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef)); -typedef CONST char** (Tcl_FSFileAttrStringsProc) _ANSI_ARGS_(( - Tcl_Obj *pathPtr, Tcl_Obj** objPtrRef)); +typedef CONST char ** (Tcl_FSFileAttrStringsProc) _ANSI_ARGS_(( + Tcl_Obj *pathPtr, Tcl_Obj **objPtrRef)); typedef int (Tcl_FSFileAttrsSetProc) _ANSI_ARGS_((Tcl_Interp *interp, int index, Tcl_Obj *pathPtr, Tcl_Obj *objPtr)); -typedef Tcl_Obj* (Tcl_FSLinkProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, +typedef Tcl_Obj * (Tcl_FSLinkProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, Tcl_Obj *toPtr, int linkType)); typedef int (Tcl_FSLoadFileProc) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj *pathPtr, Tcl_LoadHandle *handlePtr, Tcl_FSUnloadFileProc **unloadProcPtr)); typedef int (Tcl_FSPathInFilesystemProc) _ANSI_ARGS_((Tcl_Obj *pathPtr, ClientData *clientDataPtr)); -typedef Tcl_Obj* (Tcl_FSFilesystemPathTypeProc) _ANSI_ARGS_(( +typedef Tcl_Obj * (Tcl_FSFilesystemPathTypeProc) _ANSI_ARGS_(( Tcl_Obj *pathPtr)); -typedef Tcl_Obj* (Tcl_FSFilesystemSeparatorProc) _ANSI_ARGS_(( +typedef Tcl_Obj * (Tcl_FSFilesystemSeparatorProc) _ANSI_ARGS_(( Tcl_Obj *pathPtr)); typedef void (Tcl_FSFreeInternalRepProc) _ANSI_ARGS_((ClientData clientData)); typedef ClientData (Tcl_FSDupInternalRepProc) _ANSI_ARGS_(( ClientData clientData)); -typedef Tcl_Obj* (Tcl_FSInternalToNormalizedProc) _ANSI_ARGS_(( +typedef Tcl_Obj * (Tcl_FSInternalToNormalizedProc) _ANSI_ARGS_(( ClientData clientData)); typedef ClientData (Tcl_FSCreateInternalRepProc) _ANSI_ARGS_(( Tcl_Obj *pathPtr)); @@ -2204,8 +2206,9 @@ typedef unsigned long mp_digit; EXTERN CONST char * Tcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); -EXTERN CONST char* TclTomMathInitializeStubs(Tcl_Interp* interp, - CONST char* version, int epoch, int revision); +EXTERN CONST char * TclTomMathInitializeStubs _ANSI_ARGS_(( + Tcl_Interp *interp, CONST char *version, + int epoch, int revision)); #ifndef USE_TCL_STUBS @@ -2225,13 +2228,16 @@ EXTERN CONST char* TclTomMathInitializeStubs(Tcl_Interp* interp, /* * Public functions that are not accessible via the stubs table. + * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171] */ -EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, - Tcl_AppInitProc *appInitProc)); - -EXTERN CONST char *Tcl_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp, +EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, + Tcl_AppInitProc *appInitProc)); +EXTERN CONST char * Tcl_PkgInitStubsCheck _ANSI_ARGS_((Tcl_Interp *interp, CONST char *version, int exact)); +#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) +EXTERN void Tcl_GetMemoryInfo _ANSI_ARGS_((Tcl_DString *dsPtr)); +#endif /* * Include the public function declarations that are accessible via the stubs diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 430f8bc..08208a7 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.244.2.24 2008/03/10 19:33:12 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.244.2.25 2008/03/26 20:08:56 dgp Exp $ */ #include "tclInt.h" @@ -3108,8 +3108,7 @@ OldMathFuncProc( * Convert arguments from Tcl_Obj's to Tcl_Value's. */ - args = (Tcl_Value *) - TclStackAlloc(interp, dataPtr->numArgs * sizeof(Tcl_Value)); + args = (Tcl_Value *) ckalloc(dataPtr->numArgs * sizeof(Tcl_Value)); for (j = 1, k = 0; j < objc; ++j, ++k) { /* TODO: Convert to TclGetNumberFromObj() ? */ @@ -3129,7 +3128,7 @@ OldMathFuncProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "argument to math function didn't have numeric value",-1)); TclCheckBadOctal(interp, Tcl_GetString(valuePtr)); - TclStackFree(interp, args); + ckfree((char *)args); return TCL_ERROR; } @@ -3161,7 +3160,7 @@ OldMathFuncProc( break; case TCL_INT: if (ExprIntFunc(NULL, interp, 2, &(objv[j-1])) != TCL_OK) { - TclStackFree(interp, args); + ckfree((char *)args); return TCL_ERROR; } valuePtr = Tcl_GetObjResult(interp); @@ -3170,7 +3169,7 @@ OldMathFuncProc( break; case TCL_WIDE_INT: if (ExprWideFunc(NULL, interp, 2, &(objv[j-1])) != TCL_OK) { - TclStackFree(interp, args); + ckfree((char *)args); return TCL_ERROR; } valuePtr = Tcl_GetObjResult(interp); @@ -3186,7 +3185,7 @@ OldMathFuncProc( errno = 0; result = (*dataPtr->proc)(dataPtr->clientData, interp, args, &funcResult); - TclStackFree(interp, args); + ckfree((char *)args); if (result != TCL_OK) { return result; } diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 77c9c7e..949b8df 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBinary.c,v 1.35.2.2 2007/11/12 19:18:14 dgp Exp $ + * RCS: @(#) $Id: tclBinary.c,v 1.35.2.3 2008/03/26 20:08:56 dgp Exp $ */ #include "tclInt.h" @@ -786,7 +786,9 @@ Tcl_BinaryObjCmd( break; } if ((count == 0) && (cmd != '@')) { - arg++; + if (cmd != 'x') { + arg++; + } continue; } switch (cmd) { diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 7733447..b915c38 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.88.2.3 2008/03/07 22:05:02 dgp Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.88.2.4 2008/03/26 20:08:56 dgp Exp $ */ #include "tclInt.h" @@ -1799,7 +1799,7 @@ Tcl_ForeachObjCmd( valuePtr, TCL_LEAVE_ERR_MSG); if (varValuePtr == NULL) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( - "\n (setting foreach loop variable \"%s\"", + "\n (setting foreach loop variable \"%s\")", TclGetString(varvList[i][v]))); result = TCL_ERROR; goto done; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 00b1e55..09c5be8 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.115.2.13 2008/01/23 16:42:18 dgp Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.115.2.14 2008/03/26 20:08:56 dgp Exp $ */ #include "tclInt.h" @@ -3658,8 +3658,7 @@ Tcl_LsortObjCmd( * begins sorting it into the sublists as it appears. */ - elementArray = (SortElement *) - TclStackAlloc(interp, length * sizeof(SortElement)); + elementArray = (SortElement *) ckalloc( length * sizeof(SortElement)); for (i=0; i < length; i++){ if (indexc) { @@ -3762,7 +3761,7 @@ Tcl_LsortObjCmd( } done1: - TclStackFree(interp, elementArray); + ckfree((char *)elementArray); done: if (sortInfo.sortMode == SORTMODE_COMMAND) { diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 2abf5ab..e553103 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompCmds.c,v 1.109.2.20 2008/03/07 22:05:03 dgp Exp $ + * RCS: @(#) $Id: tclCompCmds.c,v 1.109.2.21 2008/03/26 20:08:56 dgp Exp $ */ #include "tclInt.h" @@ -814,7 +814,9 @@ TclCompileDictForCmd( int keyVarIndex, valueVarIndex, nameChars, loopRange, catchRange; int infoIndex, jumpDisplacement, bodyTargetOffset, emptyTargetOffset; int numVars, endTargetOffset; - int savedStackDepth = envPtr->currStackDepth; /* is this necessary? */ + int savedStackDepth = envPtr->currStackDepth; + /* Needed because jumps confuse the stack + * space calculator. */ const char **argv; Tcl_DString buffer; @@ -921,9 +923,7 @@ TclCompileDictForCmd( envPtr->line = mapPtr->loc[eclIndex].line[4]; CompileBody(envPtr, bodyTokenPtr, interp); - envPtr->currStackDepth = savedStackDepth + 1; TclEmitOpcode( INST_POP, envPtr); - envPtr->currStackDepth = savedStackDepth; /* * Both exception target ranges (error and loop) end here. @@ -977,6 +977,7 @@ TclCompileDictForCmd( * easy!) Note that we skip the END_CATCH. [Bug 1382528] */ + envPtr->currStackDepth = savedStackDepth+2; jumpDisplacement = CurrentOffset(envPtr) - emptyTargetOffset; TclUpdateInstInt4AtPc(INST_JUMP_TRUE4, jumpDisplacement, envPtr->codeStart + emptyTargetOffset); diff --git a/generic/tclExecute.c b/generic/tclExecute.c index ff308f0..3f1f445 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.285.2.31 2008/03/10 19:33:12 dgp Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.285.2.32 2008/03/26 20:08:56 dgp Exp $ */ #include "tclInt.h" @@ -860,19 +860,11 @@ TclFinalizeExecution(void) static inline int OFFSET( - Tcl_Obj **markerPtr) + void *ptr) { - /* - * Note that we are only interested in the low bits of the address, so - * that the fact that PTR2INT may lose the high bits is irrelevant. - */ - - int mask, base, new; - - mask = WALLOCALIGN-1; - base = (PTR2INT(markerPtr) & mask); - new = ((base + 1) + mask) & ~mask; - return (new - base); + int mask = TCL_ALLOCALIGN-1; + int base = PTR2INT(ptr) & mask; + return (TCL_ALLOCALIGN - base)/sizeof(Tcl_Obj**); } #define MEMSTART(markerPtr) \ diff --git a/generic/tclTest.c b/generic/tclTest.c index bc0492f..4f37f3e 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.110.2.2 2007/11/05 14:20:54 dgp Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.110.2.3 2008/03/26 20:08:58 dgp Exp $ */ #define TCL_TEST @@ -2210,7 +2210,7 @@ ExitProcOdd( char buf[16 + TCL_INTEGER_SPACE]; sprintf(buf, "odd %d\n", PTR2INT(clientData)); - write(1, buf, strlen(buf)); + (void)write(1, buf, strlen(buf)); } static void @@ -2220,7 +2220,7 @@ ExitProcEven( char buf[16 + TCL_INTEGER_SPACE]; sprintf(buf, "even %d\n", PTR2INT(clientData)); - write(1, buf, strlen(buf)); + (void)write(1, buf, strlen(buf)); } /* diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index eaf1b7d..888b549 100755 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclThreadAlloc.c,v 1.21.6.3 2008/01/23 16:42:19 dgp Exp $ + * RCS: @(#) $Id: tclThreadAlloc.c,v 1.21.6.4 2008/03/26 20:08:59 dgp Exp $ */ #include "tclInt.h" @@ -608,7 +608,7 @@ TclThreadFreeObj( *---------------------------------------------------------------------- */ -MODULE_SCOPE void +void Tcl_GetMemoryInfo( Tcl_DString *dsPtr) { @@ -986,7 +986,30 @@ TclFinalizeThreadAlloc(void) TclpFreeAllocCache(NULL); } -#else +#else /* !(TCL_THREADS && USE_THREAD_ALLOC) */ +/* + *---------------------------------------------------------------------- + * + * Tcl_GetMemoryInfo -- + * + * Return a list-of-lists of memory stats. + * + * Results: + * None. + * + * Side effects: + * List appended to given dstring. + * + *---------------------------------------------------------------------- + */ + +void +Tcl_GetMemoryInfo( + Tcl_DString *dsPtr) +{ + Tcl_Panic("Tcl_GetMemoryInfo called when threaded memory allocator not in use"); +} + /* *---------------------------------------------------------------------- * @@ -1009,7 +1032,7 @@ TclFinalizeThreadAlloc(void) { Tcl_Panic("TclFinalizeThreadAlloc called when threaded memory allocator not in use"); } -#endif /* TCL_THREADS */ +#endif /* TCL_THREADS && USE_THREAD_ALLOC */ /* * Local Variables: diff --git a/library/tm.tcl b/library/tm.tcl index 8fac14a..aee74f5 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -254,7 +254,7 @@ proc ::tcl::tm::UnknownHandler {original name args} { # means something else without the namespace # specifier. - package ifneeded $pkgname $pkgversion [::list source $file] + package ifneeded $pkgname $pkgversion [::list source -encoding utf-8 $file] # We abort in this unknown handler only if we got # a satisfying candidate for the requested @@ -321,8 +321,11 @@ proc ::tcl::tm::Defaults {} { set sep ":" } for {set n $minor} {$n >= 0} {incr n -1} { - set ev TCL${major}.${n}_TM_PATH - if {[info exists env($ev)]} { + foreach ev [::list \ + TCL${major}.${n}_TM_PATH \ + TCL${major}_${n}_TM_PATH \ + ] { + if {![info exists env($ev)]} continue foreach p [split $env($ev) $sep] { path add $p } diff --git a/tests/binary.test b/tests/binary.test index 023cc74..bba7ce6 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: binary.test,v 1.30 2006/11/29 13:59:32 dgp Exp $ +# RCS: @(#) $Id: binary.test,v 1.30.2.1 2008/03/26 20:08:59 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -545,6 +545,18 @@ test binary-15.3 {Tcl_BinaryObjCmd: format} { test binary-15.4 {Tcl_BinaryObjCmd: format} { binary format a*X3x3a* "foo" "z" } \x00\x00\x00z +test binary-15.5 {Tcl_BinaryObjCmd: format - bug #1923966} { + binary format x0s 1 +} \x01\x00 +test binary-15.6 {Tcl_BinaryObjCmd: format - bug #1923966} { + binary format x0ss 1 1 +} \x01\x00\x01\x00 +test binary-15.7 {Tcl_BinaryObjCmd: format - bug #1923966} { + binary format x1s 1 +} \x00\x01\x00 +test binary-15.8 {Tcl_BinaryObjCmd: format - bug #1923966} { + binary format x1ss 1 1 +} \x00\x01\x00\x01\x00 test binary-16.1 {Tcl_BinaryObjCmd: format} { binary format a*X*a "foo" "z" diff --git a/tests/dict.test b/tests/dict.test index 96c14fa..daecb70 100644 --- a/tests/dict.test +++ b/tests/dict.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: dict.test,v 1.20.2.2 2007/11/25 06:45:45 dgp Exp $ +# RCS: @(#) $Id: dict.test,v 1.20.2.3 2008/03/26 20:09:00 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -562,6 +562,13 @@ test dict-14.18 {dict for command in compilation context} { test dict-14.19 {dict for and invalid dicts: bug 1531184} -body { di[list]ct for {k v} x {} } -returnCodes 1 -result {missing value to go with key} +test dict-14.20 {dict for stack space compilation: bug 1903325} { + proc dicttest {x y args} { + dict for {a b} $x {} + concat "c=$y,$args" + } + dicttest {} 1 2 3 +} {c=1,2 3} # There's probably a lot more tests to add here. Really ought to use a # coverage tool for this job... diff --git a/tests/foreach.test b/tests/foreach.test index 8fb5144..0f47fe7 100644 --- a/tests/foreach.test +++ b/tests/foreach.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: foreach.test,v 1.13 2007/03/12 20:45:27 dgp Exp $ +# RCS: @(#) $Id: foreach.test,v 1.13.2.1 2008/03/26 20:09:00 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -75,7 +75,7 @@ test foreach-1.14 {foreach errors} { set a(0) 44 list [catch {foreach a {1 2 3} {}} msg o] $msg $::errorInfo } {1 {can't set "a": variable is array} {can't set "a": variable is array - (setting foreach loop variable "a" + (setting foreach loop variable "a") invoked from within "foreach a {1 2 3} {}"}} test foreach-1.15 {foreach errors} { diff --git a/tests/reg.test b/tests/reg.test index e54aa88..d12c0b9 100644 --- a/tests/reg.test +++ b/tests/reg.test @@ -9,7 +9,7 @@ # # Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. # -# RCS: @(#) $Id: reg.test,v 1.23.2.1 2008/01/23 16:42:20 dgp Exp $ +# RCS: @(#) $Id: reg.test,v 1.23.2.2 2008/03/26 20:09:00 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -1063,7 +1063,8 @@ test reg-33.12 {Bug 1810264 - bad read} { test reg-33.13 {Bug 1810264 - infinite loop} { regexp {($|^)*} {x} } 1 -test reg-33.14 {Bug 1810264 - super-expensive expression} { +# Some environments have small default stack sizes. [Bug 1905562] +test reg-33.14 {Bug 1810264 - super-expensive expression} nonPortable { regexp {(x{200}){200}$y} {x} } 0 diff --git a/tests/switch.test b/tests/switch.test index 0aaa6ad..369b2ae 100644 --- a/tests/switch.test +++ b/tests/switch.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: switch.test,v 1.16.4.3 2008/03/07 22:05:08 dgp Exp $ +# RCS: @(#) $Id: switch.test,v 1.16.4.4 2008/03/26 20:09:00 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -635,7 +635,113 @@ test switch-14.4 {-regexp -- compilation [Bug 1854399]} { } foo } yes +test switch-14.5 {switch -regexp compilation} { + apply {{} { + switch -regexp -- 0 { + {0|1|2} {return yes} + default {return no} + } + }} +} yes +test switch-14.6 {switch -regexp compilation} { + apply {{} { + switch -regexp -- 0 { + {0|11|222} {return yes} + default {return no} + } + }} +} yes +test switch-14.7 {switch -regexp compilation} { + apply {{} { + switch -regexp -- 0 { + {[012]} {return yes} + default {return no} + } + }} +} yes +test switch-14.8 {switch -regexp compilation} { + apply {{} { + switch -regexp -- x { + {0|1|2} {return yes} + default {return no} + } + }} +} no +test switch-14.9 {switch -regexp compilation} { + apply {{} { + switch -regexp -- x { + {0|11|222} {return yes} + default {return no} + } + }} +} no +test switch-14.10 {switch -regexp compilation} { + apply {{} { + switch -regexp -- x { + {[012]} {return yes} + default {return no} + } + }} +} no +test switch-14.11 {switch -regexp compilation} { + apply {{} { + switch -regexp -- x { + {0|1|2} {return yes} + .+ {return yes2} + default {return no} + } + }} +} yes2 +test switch-14.12 {switch -regexp compilation} { + apply {{} { + switch -regexp -- x { + {0|11|222} {return yes} + .+ {return yes2} + default {return no} + } + }} +} yes2 +test switch-14.13 {switch -regexp compilation} { + apply {{} { + switch -regexp -- x { + {[012]} {return yes} + .+ {return yes2} + default {return no} + } + }} +} yes2 +test switch-14.14 {switch -regexp compilation} { + apply {{} { + switch -regexp -- {} { + {0|1|2} {return yes} + .+ {return yes2} + default {return no} + } + }} +} no +test switch-14.15 {switch -regexp compilation} { + apply {{} { + switch -regexp -- {} { + {0|11|222} {return yes} + .+ {return yes2} + default {return no} + } + }} +} no +test switch-14.16 {switch -regexp compilation} { + apply {{} { + switch -regexp -- {} { + {[012]} {return yes} + .+ {return yes2} + default {return no} + } + }} +} no # cleanup ::tcltest::cleanupTests return + +# Local Variables: +# mode: tcl +# End: diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index c11ce0b..23dfe9a 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPipe.c,v 1.38.2.2 2008/03/07 22:05:11 dgp Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.38.2.3 2008/03/26 20:09:00 dgp Exp $ */ #include "tclInt.h" @@ -463,7 +463,7 @@ TclpCreateProcess( ((dup2(1,2) == -1) || (fcntl(2, F_SETFD, 0) != 0)))) { sprintf(errSpace, "%dforked process couldn't set up input/output: ", errno); - write(fd, errSpace, (size_t) strlen(errSpace)); + (void)write(fd, errSpace, (size_t) strlen(errSpace)); _exit(1); } @@ -474,7 +474,7 @@ TclpCreateProcess( RestoreSignals(); execvp(newArgv[0], newArgv); /* INTL: Native. */ sprintf(errSpace, "%dcouldn't execute \"%.150s\": ", errno, argv[0]); - write(fd, errSpace, (size_t) strlen(errSpace)); + (void)write(fd, errSpace, (size_t) strlen(errSpace)); _exit(1); } |