Fixed proxy check when there is no proxy.
authorIain Patterson <me@iain.cx>
Mon, 2 Jul 2007 07:14:13 +0000 (07:14 +0000)
committerIain Patterson <me@iain.cx>
Mon, 2 Jul 2007 07:14:13 +0000 (07:14 +0000)
git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@60 6be0d1a5-5cfe-0310-89b6-964be062b18b

.profile.d/proxy.bashrc

index 811fcbd..a0096d1 100644 (file)
@@ -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