summaryrefslogtreecommitdiffstats
path: root/library/history.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-07-23 04:12:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-07-23 04:12:46 (GMT)
commit7bc20e13c9c5f3706c7f50ae52ff329de08f8782 (patch)
tree4d2d9275d5243ea9e69abc3b325fce1875cda4bd /library/history.tcl
parent6f173b7f6fa783afed059c46c49241bebb0995b7 (diff)
downloadtcl-7bc20e13c9c5f3706c7f50ae52ff329de08f8782.zip
tcl-7bc20e13c9c5f3706c7f50ae52ff329de08f8782.tar.gz
tcl-7bc20e13c9c5f3706c7f50ae52ff329de08f8782.tar.bz2
* library/auto.tcl: Updates to the Tcl script library to make
* library/history.tcl: use of Tcl 8.4 features. Forward port of * library/init.tcl: appropriate portions of [Patch 1237755]. * library/package.tcl: * library/safe.tcl: * library/word.tcl:
Diffstat (limited to 'library/history.tcl')
-rw-r--r--library/history.tcl14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/history.tcl b/library/history.tcl
index 7304d2a..3a3f16a 100644
--- a/library/history.tcl
+++ b/library/history.tcl
@@ -2,7 +2,7 @@
#
# Implementation of the history command.
#
-# RCS: @(#) $Id: history.tcl,v 1.6 2003/03/19 21:57:42 dgp Exp $
+# RCS: @(#) $Id: history.tcl,v 1.7 2005/07/23 04:12:49 dgp Exp $
#
# Copyright (c) 1997 Sun Microsystems, Inc.
#
@@ -168,14 +168,14 @@ proc history {args} {
variable history
# Do not add empty commands to the history
- if {[string trim $command] == ""} {
+ if {[string trim $command] eq ""} {
return ""
}
set i [incr history(nextid)]
set history($i) $command
set j [incr history(oldest)]
- if {[info exists history($j)]} {unset history($j)}
+ unset -nocomplain history($j)
if {[string match e* $exec]} {
return [uplevel #0 $command]
} else {
@@ -198,13 +198,13 @@ proc history {args} {
proc tcl::HistKeep {{limit {}}} {
variable history
- if {[string length $limit] == 0} {
+ if {$limit eq ""} {
return $history(keep)
} else {
set oldold $history(oldest)
set history(oldest) [expr {$history(nextid) - $limit}]
for {} {$oldold <= $history(oldest)} {incr oldold} {
- if {[info exists history($oldold)]} {unset history($oldold)}
+ unset -nocomplain history($oldold)
}
set history(keep) $limit
}
@@ -246,7 +246,7 @@ proc history {args} {
proc tcl::HistInfo {{num {}}} {
variable history
- if {$num == {}} {
+ if {$num eq ""} {
set num [expr {$history(keep) + 1}]
}
set result {}
@@ -280,7 +280,7 @@ proc history {args} {
proc tcl::HistRedo {{event -1}} {
variable history
- if {[string length $event] == 0} {
+ if {$event eq ""} {
set event -1
}
set i [HistIndex $event]