summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Bargren <cbargren@gmail.com>2017-02-08 15:01:30 -0700
committerChristopher Bargren <cbargren@gmail.com>2017-02-08 15:01:30 -0700
commit2af282d835662fce671cc1a6675b0b8292f05173 (patch)
tree5f05f227e7b4a10beaf3cbb352435648eaf6b8eb
parent5f3276c7e66fe54b0485da2def84a6ae322cce59 (diff)
downloadlibgit2-2af282d835662fce671cc1a6675b0b8292f05173.tar.gz
Addressing PR feedback
-rw-r--r--src/remote.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/remote.c b/src/remote.c
index 1f5c58bd2..808ca78d5 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -770,21 +770,14 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
goto found;
}
- /* HTTP_PROXY / HTTPS_PROXY environment variables */
- error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY");
-
- if (error < 0) {
- if (error != GIT_ENOTFOUND) {
- return error;
- }
+ /* http_proxy / https_proxy environment variables */
+ error = git__getenv(&val, use_ssl ? "https_proxy" : "http_proxy");
- giterr_clear();
- error = 0;
+ if (error == GIT_ENOTFOUND) {
+ /* try uppercase environment variables */
+ error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY");
}
- /* try lowercase environment variables */
- error = git__getenv(&val, use_ssl ? "https_proxy" : "http_proxy");
-
if (error < 0) {
if (error == GIT_ENOTFOUND) {
giterr_clear();