rendre ppath() plus résistant
This commit is contained in:
parent
c9ce115f78
commit
8143452c1b
|
@ -637,8 +637,8 @@ function ppath() {
|
|||
[ -n "$cwd" ] || cwd="$(pwd)"
|
||||
|
||||
[ "$path" = "$cwd" ] && path="."
|
||||
[ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path/#$cwd\//}"
|
||||
path="${path/#$HOME/~}"
|
||||
[ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path#$cwd/}"
|
||||
[ "${path#$HOME/}" != "$path" ] && path="~${path#$HOME}"
|
||||
|
||||
rawecho "$path"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue