From 26b48ce090ba897a598fc42bf0a8412d5a14fee9 Mon Sep 17 00:00:00 2001 From: bert Dvornik Date: Mon, 19 Apr 2010 17:38:47 -0400 Subject: [PATCH] add-shortcut.tcl: Determine the MSYS root directory without using $INPUTRC The add-shortcut script has been finding the MSYS root directory based on the value of the INPUTRC environment variable, based on the assumption that $INPUTRC is always set to "/etc/inputrc". But this may not be the case. If "$HOME/.inputrc" exists, /etc/profile will preferentially point $INPUTRC at it. That will cause the shortcuts to be generated incorrectly. There are a few different ways to find the MSYS root; this simply assumes the root is at ../.. from the script directory. Signed-off-by: bert Dvornik Signed-off-by: Johannes Schindelin --- share/msysGit/add-shortcut.tcl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/share/msysGit/add-shortcut.tcl b/share/msysGit/add-shortcut.tcl index 1c70d3c7..3a871f3e 100644 --- a/share/msysGit/add-shortcut.tcl +++ b/share/msysGit/add-shortcut.tcl @@ -1,5 +1,8 @@ #!/mingw/bin/tclsh +cd [file dirname $argv0] +set msysRoot [file dirname [file dirname [pwd]]] + switch -regexp [lindex $argv 0] { "^(|help|-h|-help|--help)$" { puts "Usage: $argv0 \[option\]" @@ -56,7 +59,6 @@ switch -regexp [lindex $argv 0] { } "^(EnableQuickEdit|quickedit)$" { package require registry 1.0 - regsub "^(.*)/etc/inputrc" $env(INPUTRC) "\\1" msysRoot set sh [string map { "\\" "_" "/" "_" } $msysRoot/bin/sh.exe] set key "HKEY_CURRENT_USER\\Console" registry set $key "QuickEdit" 1 dword @@ -71,9 +73,6 @@ default { } } -cd [file dirname $argv0] - -regsub "^(.*)/etc/inputrc" $env(INPUTRC) "\\1" msysRoot exec make set binDirectory "$msysRoot/bin" -- 2.11.4.GIT