Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: vcs_info: Remove a few superfluous stat()s



The (( ${+commands[foo]} )) part should be save enough, to check for
existing commands.

Regards, Frank


diff --git a/Functions/VCS_Info/VCS_INFO_check_com b/Functions/VCS_Info/VCS_INFO_check_com
index d9f7a13..1b86593 100644
--- a/Functions/VCS_Info/VCS_INFO_check_com
+++ b/Functions/VCS_Info/VCS_INFO_check_com
@@ -9,7 +9,7 @@ case $1 in
         [[ -x $1 ]] && return 0
         ;;
     (*)
-        (( ${+commands[$1]} )) && [[ -x ${commands[$1]} ]] && return 0
+        (( ${+commands[$1]} )) && return 0
 esac
 
 return 1



Messages sorted by: Reverse Date, Date, Thread, Author