From 4a529201b8524bb3b149a5e7702bbaf8787617f2 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Mon, 29 Sep 2014 14:23:28 +0200 Subject: 33277: Fix VCS_INFO_reposub's command expansion Reported-by: Marco Hinz --- Functions/VCS_Info/VCS_INFO_reposub | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Functions') 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 -- cgit 1.4.1