diff --git a/liquidprompt b/liquidprompt index ba2b183..24e16e2 100755 --- a/liquidprompt +++ b/liquidprompt @@ -832,18 +832,15 @@ _lp_svn_branch() [[ "$LP_ENABLE_SVN" != 1 ]] && return local root local url - local result eval $(LANG=C LC_ALL=C svn info 2>/dev/null | sed -n 's/^URL: \(.*\)/url="\1"/p;s/^Repository Root: \(.*\)/root="\1"/p' ) - if [[ "$root" == "" ]]; then - return - fi + [[ -z "$root" ]] && return + # Make url relative to root url="${url:${#root}}" if [[ "$url" == */trunk* ]] ; then echo -n trunk else - result=$(expr "$url" : '.*/branches/\([^/]*\)' || expr "$url" : '/\([^/]*\)' || basename "$root") - echo -n $result # FIXME should be: echo -n $(_lp_escape "${result}") + _lp_escape "$(expr "$url" : '.*/branches/\([^/]*\)' || expr "$url" : '/\([^/]*\)' || basename "$root")" fi }