Skip to content

Commit 0a87286

Browse files
authored
Merge pull request libgit2#6063 from libgit2/ethomson/win32_envvar
win32: allow empty environment variables
2 parents 1396a9b + 18fc751 commit 0a87286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ int git__getenv(git_buf *out, const char *name)
755755

756756
if (value_len)
757757
error = git_buf_put_w(out, wide_value, value_len);
758-
else if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
758+
else if (GetLastError() == ERROR_SUCCESS || GetLastError() == ERROR_ENVVAR_NOT_FOUND)
759759
error = GIT_ENOTFOUND;
760760
else
761761
git_error_set(GIT_ERROR_OS, "could not read environment variable '%s'", name);

0 commit comments

Comments
 (0)