Merge branch 'master' of https://github.com/j6t/gitk
* 'master' of https://github.com/j6t/gitk: gitk: add Tamil translation gitk: limit PATH search to bare executable names gitk: _search_exe is no longer needed gitk: override $PATH search only on Windows gitk: adjust indentation to match the style used in this scriptmaint
commit
7a1d2bd0a5
|
@ -13,13 +13,6 @@ package require Tk
|
|||
##
|
||||
## Enabling platform-specific code paths
|
||||
|
||||
proc is_MacOSX {} {
|
||||
if {[tk windowingsystem] eq {aqua}} {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
proc is_Windows {} {
|
||||
if {$::tcl_platform(platform) eq {windows}} {
|
||||
return 1
|
||||
|
@ -27,36 +20,16 @@ proc is_Windows {} {
|
|||
return 0
|
||||
}
|
||||
|
||||
set _iscygwin {}
|
||||
proc is_Cygwin {} {
|
||||
global _iscygwin
|
||||
if {$_iscygwin eq {}} {
|
||||
if {[string match "CYGWIN_*" $::tcl_platform(os)]} {
|
||||
set _iscygwin 1
|
||||
} else {
|
||||
set _iscygwin 0
|
||||
}
|
||||
}
|
||||
return $_iscygwin
|
||||
}
|
||||
|
||||
######################################################################
|
||||
##
|
||||
## PATH lookup
|
||||
|
||||
if {[is_Windows]} {
|
||||
set _search_path {}
|
||||
proc _which {what args} {
|
||||
global env _search_exe _search_path
|
||||
global env _search_path
|
||||
|
||||
if {$_search_path eq {}} {
|
||||
if {[is_Cygwin] && [regexp {^(/|\.:)} $env(PATH)]} {
|
||||
set _search_path [split [exec cygpath \
|
||||
--windows \
|
||||
--path \
|
||||
--absolute \
|
||||
$env(PATH)] {;}]
|
||||
set _search_exe .exe
|
||||
} elseif {[is_Windows]} {
|
||||
set gitguidir [file dirname [info script]]
|
||||
regsub -all ";" $gitguidir "\\;" gitguidir
|
||||
set env(PATH) "$gitguidir;$env(PATH)"
|
||||
|
@ -64,17 +37,12 @@ proc _which {what args} {
|
|||
# Skip empty `PATH` elements
|
||||
set _search_path [lsearch -all -inline -not -exact \
|
||||
$_search_path ""]
|
||||
set _search_exe .exe
|
||||
} else {
|
||||
set _search_path [split $env(PATH) :]
|
||||
set _search_exe {}
|
||||
}
|
||||
}
|
||||
|
||||
if {[is_Windows] && [lsearch -exact $args -script] >= 0} {
|
||||
if {[lsearch -exact $args -script] >= 0} {
|
||||
set suffix {}
|
||||
} else {
|
||||
set suffix $_search_exe
|
||||
set suffix .exe
|
||||
}
|
||||
|
||||
foreach p $_search_path {
|
||||
|
@ -90,7 +58,7 @@ proc sanitize_command_line {command_line from_index} {
|
|||
set i $from_index
|
||||
while {$i < [llength $command_line]} {
|
||||
set cmd [lindex $command_line $i]
|
||||
if {[file pathtype $cmd] ne "absolute"} {
|
||||
if {[llength [file split $cmd]] < 2} {
|
||||
set fullpath [_which $cmd]
|
||||
if {$fullpath eq ""} {
|
||||
throw {NOT-FOUND} "$cmd not found in PATH"
|
||||
|
@ -141,6 +109,7 @@ proc open {args} {
|
|||
}
|
||||
uplevel 1 real_open $args
|
||||
}
|
||||
}
|
||||
|
||||
# End of safe PATH lookup stuff
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import('i18n').gettext('gitk',
|
|||
'pt_pt',
|
||||
'ru',
|
||||
'sv',
|
||||
'ta',
|
||||
'vi',
|
||||
'zh_cn',
|
||||
],
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue