Shorten path: fix escaping on both bash and zsh

Thanks to polyphemus (Rolf Morel) for the catch!
This commit is contained in:
Olivier Mengué 2014-01-08 09:06:03 +01:00
parent 252526f36e
commit b50f9e2e9e

View File

@ -584,9 +584,11 @@ _lp_shorten_path()
fi fi
# Escape special chars # Escape special chars
if $_LP_SHELL_bash; then if $_LP_SHELL_bash; then
LP_PWD="${ret/\\/\\\\}" LP_PWD="${ret//\\/\\\\}"
else # zsh else # zsh
LP_PWD="${ret/%/%%}" #LP_PWD="${ret//%/%%}" # This doesn't work :( zsh bug?
p='%'
LP_PWD="${ret//$p/%%}"
fi fi
} }