mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Fix bug in type command causing type -f to return true even when no file was found
darcs-hash:20060410143201-ac50b-4d8a70cd9721edcddaf11324f0b575d3f8cbace8.gz
This commit is contained in:
parent
52851a3ba4
commit
f812b9b26c
1 changed files with 6 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
||||||
function type -d (N_ "Print the type of a command")
|
function type -d (N_ "Print the type of a command")
|
||||||
|
|
||||||
# Initialize
|
# Initialize
|
||||||
set -l status 1
|
set -l res 1
|
||||||
set -l mode normal
|
set -l mode normal
|
||||||
set -l selection all
|
set -l selection all
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ function type -d (N_ "Print the type of a command")
|
||||||
if test $selection != files
|
if test $selection != files
|
||||||
|
|
||||||
if contains -- $i (functions -na)
|
if contains -- $i (functions -na)
|
||||||
set status 0
|
set res 0
|
||||||
set found 1
|
set found 1
|
||||||
switch $mode
|
switch $mode
|
||||||
case normal
|
case normal
|
||||||
|
@ -86,7 +86,8 @@ function type -d (N_ "Print the type of a command")
|
||||||
end
|
end
|
||||||
|
|
||||||
if contains -- $i (builtin -n)
|
if contains -- $i (builtin -n)
|
||||||
set status 0
|
|
||||||
|
set res 0
|
||||||
set found 1
|
set found 1
|
||||||
switch $mode
|
switch $mode
|
||||||
case normal
|
case normal
|
||||||
|
@ -107,7 +108,7 @@ function type -d (N_ "Print the type of a command")
|
||||||
|
|
||||||
set -l path (which $i ^/dev/null)
|
set -l path (which $i ^/dev/null)
|
||||||
if test -x (echo $path)
|
if test -x (echo $path)
|
||||||
set status 0
|
set res 0
|
||||||
set found 1
|
set found 1
|
||||||
switch $mode
|
switch $mode
|
||||||
case normal
|
case normal
|
||||||
|
@ -130,6 +131,6 @@ function type -d (N_ "Print the type of a command")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return $status
|
return $res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue