summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
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)]