wincred: handle empty username/password correctly
commit074bbc2875a7fa22cfe00ed2145b1915f9333327
authorJakub Bereżański <kuba@berezanscy.pl>
Wed, 26 Jun 2013 09:07:55 +0000 (26 11:07 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 10 May 2014 21:56:38 +0000 (10 16:56 -0500)
tree1c4843b110d4b40aa81dee1193baffbe97278441
parent122aa24308d19c0874793e795a84a76233c6438f
wincred: handle empty username/password correctly

Empty (length 0) usernames and/or passwords, when saved in the Windows
Credential Manager, come back as null when reading the credential.

One use case for such empty credentials is with NTLM authentication, where
empty username and password instruct libcurl to authenticate using the
credentials of the currently logged-on user (single sign-on).

When locating the relevant credentials, make empty username match null.
When outputting the credentials, handle nulls correctly.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
contrib/credential/wincred/git-credential-wincred.c