From: Iain Patterson Date: Mon, 2 Jul 2007 07:14:13 +0000 (+0000) Subject: Fixed proxy check when there is no proxy. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=eaac4916b4ac9d16d5bae80e256f946cb340b932;p=profile.git Fixed proxy check when there is no proxy. git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@60 6be0d1a5-5cfe-0310-89b6-964be062b18b --- diff --git a/.profile.d/proxy.bashrc b/.profile.d/proxy.bashrc index 811fcbd..a0096d1 100644 --- a/.profile.d/proxy.bashrc +++ b/.profile.d/proxy.bashrc @@ -6,8 +6,10 @@ servers=~/.subversion/servers if [ -r "$servers" ]; then eval $(sed -n '/^\[global\]/,/^\[/s/^http-proxy-\([^= ]*\) *= *\(.*\)/proxy_\1="\2"/p' "$servers") creds="" - [ ! -z "$proxy_username" ] && creds="$proxy_username:$proxy_password@" - export http_proxy="http://$creds$proxy_host:${proxy_port:-80}" + if [ ! -z "$proxy_host" ]; then + [ ! -z "$proxy_username" ] && creds="$proxy_username:$proxy_password@" + export http_proxy="http://$creds$proxy_host:${proxy_port:-80}" + fi fi unset proxy_username proxy_password proxy_host proxy_port creds servers