From f812b9b26cda8e8b386cbf0de08f3700811c7c9a Mon Sep 17 00:00:00 2001 From: axel Date: Tue, 11 Apr 2006 00:32:01 +1000 Subject: [PATCH] Fix bug in type command causing type -f to return true even when no file was found darcs-hash:20060410143201-ac50b-4d8a70cd9721edcddaf11324f0b575d3f8cbace8.gz --- share/functions/type.fish | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/share/functions/type.fish b/share/functions/type.fish index c0b670981..4d3dcd8d1 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