merge-recursive: adjust git-ls-tree use for the latest.
[gitweb.git] / connect.c
index a4d6d356fd3dd3a4169b94a56f71cf5ccc0cbd89..93f6f80d3e8c5f1592353b6feadb9de2c768b649 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -427,7 +427,7 @@ static int git_tcp_connect(int fd[2], const char *prog, char *host, char *path)
                memset(&sa, 0, sizeof sa);
                sa.sin_family = he->h_addrtype;
                sa.sin_port = htons(nport);
-               memcpy(&sa.sin_addr, ap, he->h_length);
+               memcpy(&sa.sin_addr, *ap, he->h_length);
 
                if (connect(sockfd, (struct sockaddr *)&sa, sizeof sa) < 0) {
                        close(sockfd);
@@ -455,6 +455,10 @@ static int rhost_len;
 static int git_proxy_command_options(const char *var, const char *value)
 {
        if (!strcmp(var, "core.gitproxy")) {
+               const char *for_pos;
+               int matchlen = -1;
+               int hostlen;
+
                if (git_proxy_command)
                        return 0;
                /* [core]
@@ -463,10 +467,7 @@ static int git_proxy_command_options(const char *var, const char *value)
                 * gitproxy = netcatter-2 for sample.xz
                 * gitproxy = netcatter-default
                 */
-               const char *for_pos = strstr(value, " for ");
-               int matchlen = -1;
-               int hostlen;
-
+               for_pos = strstr(value, " for ");
                if (!for_pos)
                        /* matches everybody */
                        matchlen = strlen(value);