summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrank Terbeck <ft@bewatermyfriend.org>2014-09-29 14:23:28 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2014-09-29 19:20:11 +0200
commit4a529201b8524bb3b149a5e7702bbaf8787617f2 (patch)
tree1c0273f977e2ab452167991e39214e469c456ae8
parentf2aaea5cd31fcca6f060e1de0cb1e91c05c716bb (diff)
downloadzsh-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>
-rw-r--r--ChangeLog5
-rw-r--r--Functions/VCS_Info/VCS_INFO_reposub7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f1fb73ed0..e9d167310 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-29  Frank Terbeck  <ft@bewatermyfriend.org>
+
+	* 33277: Functions/VCS_Info/VCS_INFO_reposub: Fix
+	VCS_INFO_reposub's command expansion
+
 2014-09-29  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* users/19183: Src/hist.c: handle unlikely error case with
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