From d0a3f3b5288cf9564bade2efdf74599e1ac24a1b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 8 Jul 2012 08:17:10 +0000 Subject: [Bug 3532186]: pkgIndex.tcl file complexity that's unwarranted: Test for ::argv variable before trying to use it --- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 8388f1f..637f6f4 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -666,8 +666,8 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) ${WISH if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ else \ - echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ - echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ + echo " || ([info exists ::argv] && [lsearch -exact \$$::argv -display] > -1))} {";\ echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ echo "} else {";\ echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ diff --git a/win/Makefile.in b/win/Makefile.in index 871f0af..19670c7 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -435,8 +435,8 @@ install-binaries: binaries @$(RM) $(PKG_INDEX); @(\ echo "if {[package vcompare [package provide Tcl] $(TCLVERSION)] != 0} { return }";\ - echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ - echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ + echo " || ([info exists ::argv] && [lsearch -exact \$$::argv -display] > -1))} {";\ echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ echo "} else {";\ echo " package ifneeded Tk $(VERSION) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ -- cgit v0.12