diff options
author | dgp <dgp@users.sourceforge.net> | 2003-10-14 15:44:52 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-10-14 15:44:52 (GMT) |
commit | b7c8b125de1f42a74d05bd5882afc2da0a88604a (patch) | |
tree | bdeafc412fed0f5ab5d71500254ea6d40c14174c /library | |
parent | 53f461a314e8fda45504e3e1d7a51595d470604e (diff) | |
download | tcl-b7c8b125de1f42a74d05bd5882afc2da0a88604a.zip tcl-b7c8b125de1f42a74d05bd5882afc2da0a88604a.tar.gz tcl-b7c8b125de1f42a74d05bd5882afc2da0a88604a.tar.bz2 |
* generic/tclBasic.c (TclAppendObjToErrorInfo): New internal routine
that appends a Tcl_Obj to the errorInfo, saving the caller the trouble
of extracting the string rep.
* generic/tclStringObj.c (TclAppendLimitedToObj): New internal
routine that supports truncated appends with optional ellipsis marking.
This single routine supports UTF-8-safe truncated appends needed in
several places throughout the Tcl source code, mostly for error and
stack messages. Clean fix for [Bug 760872].
* generic/tclInt.h: Declarations for new internal routines.
* generic/tclCmdMZ.c: Updated callers to use the new routines.
* generic/tclCompExpr.c:
* generic/tclCompile.c:
* generic/tclExecute.c:
* generic/tclIOUtil.c:
* generic/tclNamesp.c:
* generic/tclObj.c:
* generic/tclParseExpr.c:
* generic/tclProc.c:
* generic/tclStringObj.c:
* mac/tclMacResource.c:
* library/init.tcl: Updated ::errorInfo cleanup in [unknown] to
reflect slight modifications to Tcl_LogCommandInfo(). Corrects
failing init-4.* tests.
Diffstat (limited to 'library')
-rw-r--r-- | library/init.tcl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/library/init.tcl b/library/init.tcl index 8957ae4..5f69a88 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -3,7 +3,7 @@ # Default system startup file for Tcl-based applications. Defines # "unknown" procedure and auto-load facilities. # -# RCS: @(#) $Id: init.tcl,v 1.57 2003/09/23 04:49:40 dgp Exp $ +# RCS: @(#) $Id: init.tcl,v 1.58 2003/10/14 15:44:53 dgp Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -220,8 +220,12 @@ proc unknown args { # construct the stack trace. # set cinfo $args - if {[string length $cinfo] > 150} { - set cinfo "[string range $cinfo 0 149]..." + if {[string bytelength $cinfo] > 153} { + set cinfo [string range $cinfo 0 152] + while {[string bytelength $cinfo] > 150} { + set cinfo [string range $cinfo 0 end-1] + } + append cinfo ... } append cinfo "\"\n (\"uplevel\" body line 1)" append cinfo "\n invoked from within" @@ -253,7 +257,7 @@ proc unknown args { # if {$errorInfo ne "$einfo$expect"} { error "Tcl bug: unexpected stack trace in \"unknown\"" {} \ - [list CORE UNKNOWN BADTRACE $expect $errorInfo] + [list CORE UNKNOWN BADTRACE $einfo $expect $errorInfo] } return -code error -errorcode $errorCode \ -errorinfo $einfo $msg |