wincred: handle empty username/password correctly
commit3c8cbb4edc8f577940c52115c992d17575587f99
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, 30 Dec 2013 01:17:58 +0000 (29 19:17 -0600)
treedb047151705f8ff02853a23c6b866fa5851a74e5
parent10c1fbee71db66136cfbbfafe662592b1358a421
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