From bf4082eda19fcaea560008729846cd50cdf0eb4c Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 17 May 2001 08:18:56 +0000 Subject: * library/history.tcl (tcl::HistAdd): prevent empty calls from being added to the history (arndt) --- ChangeLog | 3 +++ library/history.tcl | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f9264fd..e690d1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-05-16 Jeff Hobbs + * library/history.tcl (tcl::HistAdd): prevent empty calls from + being added to the history (arndt) + * tests/error.test: updated error-1.3 message to account for string index being compiled at toplevel. * tests/appendComp.test: diff --git a/library/history.tcl b/library/history.tcl index b93a083..d75c354 100644 --- a/library/history.tcl +++ b/library/history.tcl @@ -2,7 +2,7 @@ # # Implementation of the history command. # -# RCS: @(#) $Id: history.tcl,v 1.4 2000/05/15 21:48:44 ericm Exp $ +# RCS: @(#) $Id: history.tcl,v 1.5 2001/05/17 08:18:56 hobbs Exp $ # # Copyright (c) 1997 Sun Microsystems, Inc. # @@ -166,6 +166,12 @@ proc history {args} { proc tcl::HistAdd {command {exec {}}} { variable history + + # Do not add empty commands to the history + if {[string trim $command] == ""} { + return "" + } + set i [incr history(nextid)] set history($i) $command set j [incr history(oldest)] -- cgit v0.12