From 64f93eb564913f31ae18eccece67eda3c2e8da87 Mon Sep 17 00:00:00 2001 From: polyphemus Date: Sun, 12 Jan 2014 21:59:49 +0100 Subject: [PATCH] shorten_path: Escape '%' instead of using a var When ${var//orig/replace} is intended with orig as '%' there is no need to use a variable to avoid the '//%' form if the '%' is escaped. --- liquidprompt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/liquidprompt b/liquidprompt index e54f3bb..60b507c 100755 --- a/liquidprompt +++ b/liquidprompt @@ -586,9 +586,7 @@ _lp_shorten_path() if $_LP_SHELL_bash; then LP_PWD="${ret//\\/\\\\}" else # zsh - #LP_PWD="${ret//%/%%}" # This doesn't work :( zsh bug? - p='%' - LP_PWD="${ret//$p/%%}" + LP_PWD="${ret//\%/%%}" fi }