From 05a7e4089e0fa1ba46992e35e409c3b0e15f5d18 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 25 Apr 2005 17:07:28 +0000 Subject: * library/init.tcl: Use "ni" and "in" operators. --- ChangeLog | 4 ++++ library/init.tcl | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 666c4fb..28c4b72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-04-25 Don Porter + + * library/init.tcl: Use "ni" and "in" operators. + 2005-04-25 Miguel Sofer * generic/tclExecute.c: fix for [Bug 1189274]. diff --git a/library/init.tcl b/library/init.tcl index ecce094..82540b5 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -3,7 +3,7 @@ # Default system startup file for Tcl-based applications. Defines # "unknown" procedure and auto-load facilities. # -# RCS: @(#) $Id: init.tcl,v 1.72 2005/04/19 18:44:18 dgp Exp $ +# RCS: @(#) $Id: init.tcl,v 1.73 2005/04/25 17:07:37 dgp Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -49,18 +49,18 @@ if {![info exists auto_path]} { namespace eval tcl { variable Dir foreach Dir [list $::tcl_library [file dirname $::tcl_library]] { - if {[lsearch -exact $::auto_path $Dir] < 0} { + if {$Dir ni $::auto_path} { lappend ::auto_path $Dir } } set Dir [file join [file dirname [file dirname \ [info nameofexecutable]]] lib] - if {[lsearch -exact $::auto_path $Dir] < 0} { + if {$Dir ni $::auto_path} { lappend ::auto_path $Dir } catch { foreach Dir $::tcl_pkgPath { - if {[lsearch -exact $::auto_path $Dir] < 0} { + if {$Dir ni $::auto_path} { lappend ::auto_path $Dir } } @@ -68,7 +68,7 @@ namespace eval tcl { variable Path [unsupported::EncodingDirs] set Dir [file join $::tcl_library encoding] - if {[lsearch -exact $Path $Dir] < 0} { + if {$Dir ni $Path} { lappend Path $Dir unsupported::EncodingDirs $Path } @@ -603,7 +603,7 @@ proc auto_execok name { set execExtensions [list {} .com .exe .bat] } - if {[lsearch -exact $shellBuiltins $name] != -1} { + if {$name in $shellBuiltins} { # When this is command.com for some reason on Win2K, Tcl won't # exec it unless the case is right, which this corrects. COMSPEC # may not point to a real file, so do the check. @@ -707,7 +707,7 @@ proc tcl::CopyDirectory {action src dest} { if {$action eq "renaming"} { # Can't rename volumes. We could give a more precise # error message here, but that would break the test suite. - if {[lsearch -exact [file volumes] $nsrc] != -1} { + if {$nsrc in [file volumes]} { return -code error "error $action \"$src\" to\ \"$dest\": trying to rename a volume or move a directory\ into itself" -- cgit v0.12