diff options
author | Frank Terbeck <ft@bewatermyfriend.org> | 2014-09-29 14:23:28 +0200 |
---|---|---|
committer | Frank Terbeck <ft@bewatermyfriend.org> | 2014-09-29 19:20:11 +0200 |
commit | 4a529201b8524bb3b149a5e7702bbaf8787617f2 (patch) | |
tree | 1c0273f977e2ab452167991e39214e469c456ae8 /Functions/VCS_Info/VCS_INFO_reposub | |
parent | f2aaea5cd31fcca6f060e1de0cb1e91c05c716bb (diff) | |
download | zsh-4a529201b8524bb3b149a5e7702bbaf8787617f2.tar.gz zsh-4a529201b8524bb3b149a5e7702bbaf8787617f2.tar.xz zsh-4a529201b8524bb3b149a5e7702bbaf8787617f2.zip |
33277: Fix VCS_INFO_reposub's command expansion
Reported-by: Marco Hinz <mh.codebro@gmail.com>
Diffstat (limited to 'Functions/VCS_Info/VCS_INFO_reposub')
-rw-r--r-- | Functions/VCS_Info/VCS_INFO_reposub | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Functions/VCS_Info/VCS_INFO_reposub b/Functions/VCS_Info/VCS_INFO_reposub index 1c16f0e7b..8ebc90b6e 100644 --- a/Functions/VCS_Info/VCS_INFO_reposub +++ b/Functions/VCS_Info/VCS_INFO_reposub @@ -3,11 +3,12 @@ ## Distributed under the same BSD-ish license as zsh itself. setopt localoptions extendedglob NO_shwordsplit -local base=${1%%/##} +local base=${1%%/##} tmp -[[ $(pwd -P) == ${base}/* ]] || { +tmp="$(pwd -P)" +[[ $tmp == ${base}/* ]] || { printf '.' return 1 } -printf '%s' ${$(pwd -P)#$base/} +printf '%s' ${tmp#$base/} return 0 |