diff options
Diffstat (limited to 'src/proxy.c')
| -rw-r--r-- | src/proxy.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/proxy.c b/src/proxy.c index 2112596e9..f53ac1151 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -14,3 +14,19 @@ int git_proxy_init_options(git_proxy_options *opts, unsigned int version) opts, version, git_proxy_options, GIT_PROXY_OPTIONS_INIT); return 0; } + +int git_proxy_options_dup(git_proxy_options *tgt, const git_proxy_options *src) +{ + if (!src) { + git_proxy_init_options(tgt, GIT_PROXY_OPTIONS_VERSION); + return 0; + } + + memcpy(tgt, src, sizeof(git_proxy_options)); + if (src->url) { + tgt->url = git__strdup(src->url); + GITERR_CHECK_ALLOC(tgt->url); + } + + return 0; +} |
