diff --git a/lib/ulib/base b/lib/ulib/base index 2742ba6..6f36d6e 100644 --- a/lib/ulib/base +++ b/lib/ulib/base @@ -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" }