diff options
author | Steve Bennett <steveb@workware.net.au> | 2023-06-19 13:33:08 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2023-06-21 18:46:13 +1000 |
commit | 6894d4378bc36d0fbe1b89e168b9108c69ee5b41 (patch) | |
tree | b0a8bd6865dd899a58d87e345dc4781f3ea5335a | |
parent | e6ce71c939700b9d550bbf907993196ea3aae7b0 (diff) | |
download | jimtcl-6894d4378bc36d0fbe1b89e168b9108c69ee5b41.zip jimtcl-6894d4378bc36d0fbe1b89e168b9108c69ee5b41.tar.gz jimtcl-6894d4378bc36d0fbe1b89e168b9108c69ee5b41.tar.bz2 |
stackdump: truncate command at first newline
Often the command in a stack trace will be a long script.
This makes it hard to read the stacktrace, so in this case
truncate at the first newline and add ...
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | stdlib.tcl | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -48,6 +48,10 @@ proc stackdump {stacktrace} { if {$line ne ""} { lappend lines $line if {$cmd ne ""} { + set nl [string first \n $cmd 1] + if {$nl >= 0} { + set cmd [string range $cmd 0 $nl-1]... + } lappend lines " $cmd" } } |