diff options
author | axel <axel@liljencrantz.se> | 2006-04-11 00:32:01 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-04-11 00:32:01 +1000 |
commit | f812b9b26cda8e8b386cbf0de08f3700811c7c9a (patch) | |
tree | 597b9f4871d820e8a5ffa05c796e5dec9477c9af /share/functions/type.fish | |
parent | 52851a3ba4521f878bbabf74e0dad834b2052a18 (diff) |
Fix bug in type command causing type -f to return true even when no file was found
darcs-hash:20060410143201-ac50b-4d8a70cd9721edcddaf11324f0b575d3f8cbace8.gz
Diffstat (limited to 'share/functions/type.fish')
-rw-r--r-- | share/functions/type.fish | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/share/functions/type.fish b/share/functions/type.fish index c0b67098..4d3dcd8d 100644 --- a/share/functions/type.fish +++ b/share/functions/type.fish @@ -2,7 +2,7 @@ function type -d (N_ "Print the type of a command") # Initialize - set -l status 1 + set -l res 1 set -l mode normal set -l selection all @@ -66,7 +66,7 @@ function type -d (N_ "Print the type of a command") if test $selection != files if contains -- $i (functions -na) - set status 0 + set res 0 set found 1 switch $mode case normal @@ -86,7 +86,8 @@ function type -d (N_ "Print the type of a command") end if contains -- $i (builtin -n) - set status 0 + + set res 0 set found 1 switch $mode case normal @@ -107,7 +108,7 @@ function type -d (N_ "Print the type of a command") set -l path (which $i ^/dev/null) if test -x (echo $path) - set status 0 + set res 0 set found 1 switch $mode case normal @@ -130,6 +131,6 @@ function type -d (N_ "Print the type of a command") end - return $status + return $res end |