diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-04-23 22:07:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-23 22:07:45 -0700 |
commit | 4c01f67d9102942cc7f0a737de4c609a6ac1832e (patch) | |
tree | b1e2e725ac7fb708dba5a732271d45d675ed5bfd /config.c | |
parent | 848d9a9bb7407cd3a2d45941f732b2ddc32588a7 (diff) | |
parent | 37ee680d9b90fe4c4fc5be4e14f17baf49f6ce59 (diff) | |
download | git-4c01f67d9102942cc7f0a737de4c609a6ac1832e.tar.gz |
Merge branch 'dt/http-postbuffer-can-be-large'
Allow the http.postbuffer configuration variable to be set to a
size that can be expressed in size_t, which can be larger than
ulong on some platforms.
* dt/http-postbuffer-can-be-large:
http.postbuffer: allow full range of ssize_t values
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -834,6 +834,15 @@ int git_parse_ulong(const char *value, unsigned long *ret) return 1; } +static int git_parse_ssize_t(const char *value, ssize_t *ret) +{ + intmax_t tmp; + if (!git_parse_signed(value, &tmp, maximum_signed_value_of_type(ssize_t))) + return 0; + *ret = tmp; + return 1; +} + NORETURN static void die_bad_number(const char *name, const char *value) { @@ -892,6 +901,14 @@ unsigned long git_config_ulong(const char *name, const char *value) return ret; } +ssize_t git_config_ssize_t(const char *name, const char *value) +{ + ssize_t ret; + if (!git_parse_ssize_t(value, &ret)) + die_bad_number(name, value); + return ret; +} + int git_parse_maybe_bool(const char *value) { if (!value) |