--- tla-1.1-0pre9.orig/src/tla/libarch/pfs-dav.c +++ tla-1.1-0pre9/src/tla/libarch/pfs-dav.c @@ -225,19 +225,30 @@ if (proxy && !str_cmp_prefix ("http://", proxy)) { - proxy += 7; - proxy_port = str_chr_index (proxy, ':'); - + const t_uchar * proxy_host; + t_uchar * slash; + + proxy_host = proxy + 7; + + slash = str_chr_index (proxy_host, '/'); + if (slash) + *slash = 0; + + proxy_port = str_chr_index (proxy_host, ':'); if (proxy_port) { + *proxy_port = 0; if (cvt_decimal_to_int (&ign, &proxy_port_num, proxy_port + 1, str_length (proxy_port + 1))) { safe_printfmt (2, "ill formated http proxy port number from $http_proxy\n"); exit (2); } - ne_session_proxy (answer->sess, proxy, proxy_port_num); } + else + proxy_port_num = 80; + + ne_session_proxy (answer->sess, proxy_host, proxy_port_num); } if (root_path)