summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-09-20 14:00:36 -0400
committerGitHub <noreply@github.com>2021-09-20 14:00:36 -0400
commit0a8728622ecf77ce4185139761b31f0c6f77f04e (patch)
tree1f4c4edf5264cc61f5ccf86cf7b3af1cc698a23a
parent1396a9b556ce60da01c99b009ef91d22e5404702 (diff)
parent18fc751e00cfaeed17ad9360b06c07723c0b90fc (diff)
downloadlibgit2-0a8728622ecf77ce4185139761b31f0c6f77f04e.tar.gz
Merge pull request #6063 from libgit2/ethomson/win32_envvar
win32: allow empty environment variables
-rw-r--r--src/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index c7af2961a..9b0c45ce8 100644
--- a/src/util.c
+++ b/src/util.c
@@ -755,7 +755,7 @@ int git__getenv(git_buf *out, const char *name)
if (value_len)
error = git_buf_put_w(out, wide_value, value_len);
- else if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+ else if (GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_ENVVAR_NOT_FOUND)
error = GIT_ENOTFOUND;
else
git_error_set(GIT_ERROR_OS, "could not read environment variable '%s'", name);