mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-05-30 11:56:04 +02:00
4a529201b8
Reported-by: Marco Hinz <mh.codebro@gmail.com>
15 lines
313 B
Bash
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
|