1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-30 11:56:04 +02:00
zsh/Functions/VCS_Info/VCS_INFO_reposub
Frank Terbeck 4a529201b8 33277: Fix VCS_INFO_reposub's command expansion
Reported-by: Marco Hinz <mh.codebro@gmail.com>
2014-09-29 19:20:11 +02:00

15 lines
313 B
Bash

## vim:ft=zsh
## Written by Frank Terbeck <ft@bewatermyfriend.org>
## Distributed under the same BSD-ish license as zsh itself.
setopt localoptions extendedglob NO_shwordsplit
local base=${1%%/##} tmp
tmp="$(pwd -P)"
[[ $tmp == ${base}/* ]] || {
printf '.'
return 1
}
printf '%s' ${tmp#$base/}
return 0