Skip to content

Commit 2fe71c3

Browse files
nyckyta-tmpdscho
authored andcommitted
credential.c: fix credential reading with regards to CR/LF
This fix makes using Git credentials more friendly to Windows users. In previous version it was unable to finish input correctly without configuration changes (tested in PowerShell, CMD, Cygwin). We know credential filling should be finished by empty input, but the current implementation does not take into account CR/LF ending, and hence instead of the empty string we get '\r', which is interpreted as an incorrect string. So this commit changes default reading function to a more Windows compatible reading function. Signed-off-by: Nikita Leonov <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5abc82c commit 2fe71c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

credential.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ int credential_read(struct credential *c, FILE *fp)
176176
{
177177
struct strbuf line = STRBUF_INIT;
178178

179-
while (strbuf_getline_lf(&line, fp) != EOF) {
179+
while (strbuf_getline(&line, fp) != EOF) {
180180
char *key = line.buf;
181181
char *value = strchr(key, '=');
182182

0 commit comments

Comments
 (0)