From d6c4e4c6922ecf2dd57b66729c7cbf593d0db6bd Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 6 Nov 2009 14:35:33 +0000 Subject: Frank Terbeck: 27353: more VCS_Info sanity checks --- ChangeLog | 7 ++++++- Functions/VCS_Info/VCS_INFO_bydir_detect | 1 + Functions/VCS_Info/vcs_info | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2877b8d81..55f558e75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-06 Peter Stephenson + + * Frank Terbeck: 27353: Functions/VCS_Info/VCS_INFO_bydir_detect, + Functions/VCS_Info/vcs_info: More sanity checks for vcs_info + 2009-11-05 Peter Stephenson * Jun T.: 27351: zdelattr missed first argument. @@ -12296,5 +12301,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4802 $ +* $Revision: 1.4803 $ ***************************************************** 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 -- cgit 1.4.1