wincred: handle empty username/password correctly
commita80452d8803b4c1439cb63a4df358ee29b0e56b6
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>
Thu, 7 Nov 2013 23:27:21 +0000 (7 17:27 -0600)
treef3b10f979bc1c1164af637b4c1efd57a58203c4b
parent38d972531b9d67b1b44131ed1ffc92dceb04d586
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