diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-04 19:56:28 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-03-04 19:56:28 (GMT) |
commit | a38272a24a3f5ae9daef383b6bfc1de57ad1deab (patch) | |
tree | 44dc7b1d7583103b103563ed32bea9c6257caf10 | |
parent | a6835076ce05860e0d4e72d760da19d166b2661a (diff) | |
parent | 140c60456401d8ff840bc670f84b0d072cddd80f (diff) | |
download | tcl-a38272a24a3f5ae9daef383b6bfc1de57ad1deab.zip tcl-a38272a24a3f5ae9daef383b6bfc1de57ad1deab.tar.gz tcl-a38272a24a3f5ae9daef383b6bfc1de57ad1deab.tar.bz2 |
Merge 8.6. TCL_PACKAGE_PATH is not used on Windows
-rw-r--r-- | library/clock.tcl | 4 | ||||
-rw-r--r-- | library/init.tcl | 41 | ||||
-rw-r--r-- | unix/tclUnixInit.c | 13 | ||||
-rw-r--r-- | win/configure.in | 14 | ||||
-rw-r--r-- | win/makefile.vc | 1 | ||||
-rw-r--r-- | win/tclConfig.sh.in | 2 |
6 files changed, 32 insertions, 43 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index b9bbc2c..e578f4d 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -31,7 +31,7 @@ uplevel \#0 { # library code can find message catalogs and time zone definition files. namespace eval ::tcl::clock \ - [list variable LibDir [file dirname [info script]]] + [list variable LibDir [info library]] #---------------------------------------------------------------------- # @@ -554,6 +554,8 @@ proc ::tcl::clock::Initialize {} { pdt -0700 \ yst -0900 \ ydt -0800 \ + akst -0900 \ + akdt -0800 \ hst -1000 \ hdt -0900 \ cat -1000 \ diff --git a/library/init.tcl b/library/init.tcl index 1a51294..e57c5ce 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -6,7 +6,9 @@ # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 Scriptics Corporation. -# Copyright (c) 2004 Kevin B. Kenny. All rights reserved. +# Copyright (c) 2004 Kevin B. Kenny. +# +# All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -49,6 +51,7 @@ if {![info exists auto_path]} { set auto_path "" } } + namespace eval tcl { if {![interp issafe]} { variable Dir @@ -423,16 +426,20 @@ proc unknown args { proc auto_load {cmd {namespace {}}} { global auto_index auto_path + # qualify names: if {$namespace eq ""} { set namespace [uplevel 1 [list ::namespace current]] } set nameList [auto_qualify $cmd $namespace] # workaround non canonical auto_index entries that might be around # from older auto_mkindex versions - lappend nameList $cmd - foreach name $nameList { + if {$cmd ni $nameList} {lappend nameList $cmd} + + # try to load (and create sub-cmd handler "_sub_load_cmd" for further usage): + foreach name $nameList [set _sub_load_cmd { + # via auto_index: if {[info exists auto_index($name)]} { - namespace eval :: $auto_index($name) + namespace inscope :: $auto_index($name) # There's a couple of ways to look for a command of a given # name. One is to use # info commands $name @@ -444,22 +451,19 @@ proc auto_load {cmd {namespace {}}} { return 1 } } - } + }] + + # load auto_index if possible: if {![info exists auto_path]} { return 0 } - if {![auto_load_index]} { return 0 } - foreach name $nameList { - if {[info exists auto_index($name)]} { - namespace eval :: $auto_index($name) - if {[namespace which -command $name] ne ""} { - return 1 - } - } - } + + # try again (something new could be loaded): + foreach name $nameList $_sub_load_cmd + return 0 } @@ -610,7 +614,7 @@ proc auto_import {pattern} { foreach name [array names auto_index $pattern] { if {([namespace which -command $name] eq "") && ([namespace qualifiers $pattern] eq [namespace qualifiers $name])} { - namespace eval :: $auto_index($name) + namespace inscope :: $auto_index($name) } } } @@ -673,17 +677,14 @@ proc auto_execok name { return "" } - set path "[file dirname [info nameof]];.;" + set path "[file dirname [info nameofexecutable]];.;" if {[info exists env(SystemRoot)]} { set windir $env(SystemRoot) } elseif {[info exists env(WINDIR)]} { set windir $env(WINDIR) } if {[info exists windir]} { - if {$tcl_platform(os) eq "Windows NT"} { - append path "$windir/system32;" - } - append path "$windir/system;$windir;" + append path "$windir/system32;$windir/system;$windir;" } foreach var {PATH Path path} { diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 4e22e5b..5a27359 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -4,7 +4,7 @@ * Contains the Unix-specific interpreter initialization functions. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1999 by Scriptics Corporation. + * Copyright (c) 1999 Scriptics Corporation. * All rights reserved. */ @@ -110,7 +110,7 @@ static char defaultLibraryDir[sizeof(TCL_LIBRARY)+200] = TCL_LIBRARY; * Makefile. */ -static char pkgPath1[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH; +static char pkgPath[sizeof(TCL_PACKAGE_PATH)+200] = TCL_PACKAGE_PATH; /* * The following table is used to map from Unix locale strings to encoding @@ -371,13 +371,13 @@ TclpInitPlatform(void) * Make sure, that the standard FDs exist. [Bug 772288] */ - if (TclOSseek(0, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) { + if (TclOSseek(0, 0, SEEK_CUR) == -1 && errno == EBADF) { open("/dev/null", O_RDONLY); } - if (TclOSseek(1, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) { + if (TclOSseek(1, 0, SEEK_CUR) == -1 && errno == EBADF) { open("/dev/null", O_WRONLY); } - if (TclOSseek(2, (Tcl_SeekOffset) 0, SEEK_CUR) == -1 && errno == EBADF) { + if (TclOSseek(2, 0, SEEK_CUR) == -1 && errno == EBADF) { open("/dev/null", O_WRONLY); } @@ -853,7 +853,7 @@ TclpSetVariables( } } #endif /* HAVE_COREFOUNDATION */ - p = pkgPath1; + p = pkgPath; while ((q = strchr(p, ':')) != NULL) { Tcl_ListObjAppendElement(NULL, pkgListObj, Tcl_NewStringObj(p, q-p)); p = q+1; @@ -900,6 +900,7 @@ TclpSetVariables( #elif !defined NO_UNAME if (uname(&name) >= 0) { const char *native; + Tcl_DString ds; unameOK = 1; diff --git a/win/configure.in b/win/configure.in index 02cc79b..80c1f15 100644 --- a/win/configure.in +++ b/win/configure.in @@ -364,19 +364,6 @@ else fi fi -#-------------------------------------------------------------------- -# The statements below define the symbol TCL_PACKAGE_PATH, which -# gives a list of directories that may contain packages. The list -# consists of one directory for machine-dependent binaries and -# another for platform-independent scripts. -#-------------------------------------------------------------------- - -if test "$prefix/lib" != "$libdir"; then - TCL_PACKAGE_PATH="${libdir}:${prefix}/lib" -else - TCL_PACKAGE_PATH="${prefix}/lib" -fi - # The tclsh.exe.manifest requires these # TCL_WIN_VERSION is the 4 dotted pair Windows version format which needs # the release level, and must account for interim release versioning @@ -464,7 +451,6 @@ AC_SUBST(TCL_LD_SEARCH_FLAGS) AC_SUBST(TCL_BUILD_EXP_FILE) AC_SUBST(TCL_EXP_FILE) AC_SUBST(DL_LIBS) -AC_SUBST(TCL_PACKAGE_PATH) # win only AC_SUBST(TCL_DDE_VERSION) diff --git a/win/makefile.vc b/win/makefile.vc index ef67c66..e94e3db 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -717,7 +717,6 @@ $(OUT_DIR)\tclConfig.sh: $(WIN_DIR)\tclConfig.sh.in @TCL_LIB_SPEC@ $(LIB_INSTALL_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
@TCL_INCLUDE_SPEC@ -I$(INCLUDE_INSTALL_DIR)
@TCL_SRC_DIR@ $(ROOT)
-@TCL_PACKAGE_PATH@
@TCL_STUB_LIB_FILE@ $(TCLSTUBLIBNAME)
@TCL_STUB_LIB_FLAG@ $(TCLSTUBLIBNAME)
@TCL_STUB_LIB_SPEC@ -L$(LIB_INSTALL_DIR) $(TCLSTUBLIBNAME)
diff --git a/win/tclConfig.sh.in b/win/tclConfig.sh.in index aba0532..d69a9da 100644 --- a/win/tclConfig.sh.in +++ b/win/tclConfig.sh.in @@ -148,7 +148,7 @@ TCL_SRC_DIR='@TCL_SRC_DIR@' # List of standard directories in which to look for packages during # "package require" commands. Contains the "prefix" directory plus also # the "exec_prefix" directory, if it is different. -TCL_PACKAGE_PATH='@TCL_PACKAGE_PATH@' +TCL_PACKAGE_PATH='' # Tcl supports stub. TCL_SUPPORTS_STUBS=1 |