summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--library/history.tcl8
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f9264fd..e690d1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2001-05-16 Jeff Hobbs <jeffh@ActiveState.com>
+ * 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)]