rendre ppath() plus résistant

This commit is contained in:
Jephté Clain 2016-05-10 20:06:05 +04:00
parent c9ce115f78
commit 8143452c1b
1 changed files with 2 additions and 2 deletions

View File

@ -637,8 +637,8 @@ function ppath() {
[ -n "$cwd" ] || cwd="$(pwd)" [ -n "$cwd" ] || cwd="$(pwd)"
[ "$path" = "$cwd" ] && path="." [ "$path" = "$cwd" ] && path="."
[ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path/#$cwd\//}" [ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path#$cwd/}"
path="${path/#$HOME/~}" [ "${path#$HOME/}" != "$path" ] && path="~${path#$HOME}"
rawecho "$path" rawecho "$path"
} }