Skip to content

Commit 3223662

Browse files
committed
Merge 'non-win-fixes' into HEAD
2 parents 4c99183 + 2e91cfe commit 3223662

File tree

9 files changed

+42
-10
lines changed

9 files changed

+42
-10
lines changed

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,14 +1035,11 @@ else
10351035
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
10361036
PROGRAM_OBJS += http-fetch.o
10371037
PROGRAMS += $(REMOTE_CURL_NAMES)
1038-
curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1039-
ifeq "$(curl_check)" "070908"
1038+
ifndef NO_CURL_MULTI
10401039
ifndef NO_EXPAT
10411040
PROGRAM_OBJS += http-push.o
10421041
endif
1043-
endif
1044-
curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
1045-
ifeq "$(curl_check)" "072200"
1042+
# Assume that cURL is new enough
10461043
USE_CURL_FOR_IMAP_SEND = YesPlease
10471044
endif
10481045
ifdef USE_CURL_FOR_IMAP_SEND

compat/regex/regcomp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1919
02110-1301 USA. */
2020

21+
#include <stdint.h>
22+
2123
static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
2224
size_t length, reg_syntax_t syntax);
2325
static void re_compile_fastmap_iter (regex_t *bufp,
@@ -2577,7 +2579,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
25772579
old_tree = NULL;
25782580

25792581
if (elem->token.type == SUBEXP)
2580-
postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
2582+
postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx);
25812583

25822584
tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
25832585
if (BE (tree == NULL, 0))
@@ -3806,7 +3808,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
38063808
static reg_errcode_t
38073809
mark_opt_subexp (void *extra, bin_tree_t *node)
38083810
{
3809-
int idx = (int) (long) extra;
3811+
int idx = (int) (intptr_t) extra;
38103812
if (node->token.type == SUBEXP && node->token.opr.idx == idx)
38113813
node->token.opt_subexp = 1;
38123814

configure.ac

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,17 @@ AC_CHECK_LIB([curl], [curl_global_init],
521521
[NO_CURL=],
522522
[NO_CURL=YesPlease])
523523

524+
if test -z "$NO_CURL"; then
525+
526+
AC_CHECK_DECLS([curl_multi_init],
527+
[NO_CURL_MULTI=],
528+
[NO_CURL_MULTI=UnfortunatelyYes],
529+
[[#include <curl/curl.h>]])
530+
531+
GIT_CONF_SUBST([NO_CURL_MULTI])
532+
533+
fi
534+
524535
GIT_UNSTASH_FLAGS($CURLDIR)
525536

526537
GIT_CONF_SUBST([NO_CURL])

git-compat-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ extern int git_lstat(const char *, struct stat *);
516516
#endif
517517

518518
#define DEFAULT_PACKED_GIT_LIMIT \
519-
((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256))
519+
((1024L * 1024L) * (size_t)(sizeof(void*) >= 8 ? 8192 : 256))
520520

521521
#ifdef NO_PREAD
522522
#define pread git_pread

http.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,17 @@ static CURL *get_curl_handle(void)
386386
if (curl_http_proxy) {
387387
curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
388388
curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
389+
#if LIBCURL_VERSION_NUM >= 0x071800
390+
if (starts_with(curl_http_proxy, "socks5"))
391+
curl_easy_setopt(result,
392+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
393+
else if (starts_with(curl_http_proxy, "socks4a"))
394+
curl_easy_setopt(result,
395+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
396+
else if (starts_with(curl_http_proxy, "socks"))
397+
curl_easy_setopt(result,
398+
CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
399+
#endif
389400
}
390401

391402
set_curl_keepalive(result);

imap-send.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
14221422
curl_easy_setopt(curl, CURLOPT_PORT, server.port);
14231423

14241424
if (server.auth_method) {
1425+
#if LIBCURL_VERSION_NUM < 0x072200
1426+
warning("No LOGIN_OPTIONS support in this cURL version");
1427+
#else
14251428
struct strbuf auth = STRBUF_INIT;
14261429
strbuf_addstr(&auth, "AUTH=");
14271430
strbuf_addstr(&auth, server.auth_method);
14281431
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
14291432
strbuf_release(&auth);
1433+
#endif
14301434
}
14311435

14321436
if (!server.use_ssl)

pack-revindex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int pack_revindex_hashsz;
2121

2222
static int pack_revindex_ix(struct packed_git *p)
2323
{
24-
unsigned long ui = (unsigned long)p;
24+
unsigned long ui = (unsigned long)(intptr_t)p;
2525
int i;
2626

2727
ui = ui ^ (ui >> 16); /* defeat structure alignment */

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,7 @@ static unsigned long pack_entry_hash(struct packed_git *p, off_t base_offset)
20172017
{
20182018
unsigned long hash;
20192019

2020-
hash = (unsigned long)p + (unsigned long)base_offset;
2020+
hash = (unsigned long)(intptr_t)p + (unsigned long)base_offset;
20212021
hash += (hash >> 8) + (hash >> 16);
20222022
return hash % MAX_DELTA_CACHE;
20232023
}

wrap-for-bin.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
1919
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
2020
export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
2121

22+
if test -n "$TEST_GDB_GIT"
23+
then
24+
exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
25+
echo "Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*" >&2
26+
exit 1
27+
fi
28+
2229
exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"

0 commit comments

Comments
 (0)