about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
Diffstat (limited to 'Functions')
-rw-r--r--Functions/VCS_Info/VCS_INFO_bydir_detect1
-rw-r--r--Functions/VCS_Info/vcs_info2
2 files changed, 3 insertions, 0 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_bydir_detect b/Functions/VCS_Info/VCS_INFO_bydir_detect
index 7985b6994..0b5996fd8 100644
--- a/Functions/VCS_Info/VCS_INFO_bydir_detect
+++ b/Functions/VCS_Info/VCS_INFO_bydir_detect
@@ -8,6 +8,7 @@ local basedir="." realbasedir
 
 realbasedir="$(VCS_INFO_realpath ${basedir})"
 while [[ ${realbasedir} != '/' ]]; do
+    [[ -r ${realbasedir} ]] || return 1
     if [[ -n ${vcs_comm[detect_need_file]} ]] ; then
         [[ -d ${basedir}/${dirname} ]] && \
         [[ -e ${basedir}/${dirname}/${vcs_comm[detect_need_file]} ]] && \
diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info
index a821e4d03..4344d0b6e 100644
--- a/Functions/VCS_Info/vcs_info
+++ b/Functions/VCS_Info/vcs_info
@@ -41,6 +41,8 @@ vcs_info () {
     emulate -L zsh
     setopt extendedglob
 
+    [[ -r . ]] || return 0
+
     local pat
     local -i found
     local -a enabled disabled dps