summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-05-17 08:18:56 (GMT)
committerhobbs <hobbs>2001-05-17 08:18:56 (GMT)
commitbf4082eda19fcaea560008729846cd50cdf0eb4c (patch)
treebb33cec558ac6a21b730d7a06a9c4280e55e974a /library
parent4347f67c557afb989b2e46c3f2c24fe9a770dda5 (diff)
downloadtcl-bf4082eda19fcaea560008729846cd50cdf0eb4c.zip
tcl-bf4082eda19fcaea560008729846cd50cdf0eb4c.tar.gz
tcl-bf4082eda19fcaea560008729846cd50cdf0eb4c.tar.bz2
* library/history.tcl (tcl::HistAdd): prevent empty calls from
being added to the history (arndt)
Diffstat (limited to 'library')
-rw-r--r--library/history.tcl8
1 files changed, 7 insertions, 1 deletions
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)]