 +#ifdef WIN32
 +static char* wstrToCstr( LPWSTR wStr )
 +{
-+	int bufSize;
-+	char* out = NULL;
-+	if ( wStr != NULL )
-+	{
-+		bufSize = WideCharToMultiByte( CP_ACP,  0, wStr, -1, NULL, 0, NULL, NULL );
-+		out = ( char* )malloc( bufSize * sizeof(char));
-+		WideCharToMultiByte( CP_ACP, 0, wStr, -1, out, bufSize, NULL, NULL );
-+	}
-+	return out;
++    int bufSize;
++    char* out = NULL;
++    if ( wStr != NULL )
++    {
++        bufSize = WideCharToMultiByte( CP_ACP,  0, wStr, -1, NULL, 0, NULL, NULL );
++        out = ( char* )malloc( bufSize * sizeof(char));
++        WideCharToMultiByte( CP_ACP, 0, wStr, -1, out, bufSize, NULL, NULL );
++    }
++    return out;
 +}
 +#endif
 +

+    else {
+      /* TODO Handle the Proxy config Auto Detection case */
+    }
+		
+    GlobalFree( ieProxyConfig->lpszAutoConfigUrl );
+		GlobalFree( ieProxyConfig->lpszProxy );
+		GlobalFree( ieProxyConfig->lpszProxyBypass );
+  }
+#else /* !WIN32 */
   char proxy_env[128];

+    if(!ieProxyConfig->fAutoDetect) {
+      char *ieProxy;
+      char *ieNoProxy;
+      char* pos;
+
+      ieProxy = wstrToCstr(ieProxyConfig->lpszProxy);
+      ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass);
+
+      /* Convert the ieNoProxy into a proper no_proxy value */
+      no_proxy = strdup(ieNoProxy);
+      pos = strpbrk(no_proxy, "; ");
+      while (NULL != pos) {
