wincred: handle empty username/password correctly
commita113b10142dab53092db5cd9accfba2052ab1ba2
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>
Mon, 17 Feb 2014 18:02:42 +0000 (17 12:02 -0600)
treeb1cfe5629a128e5f182f60d5326fb1d8462fa0a2
parentdbc56a51aa3685ac5c2eff0f24ac06767b502c99
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