mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
MinGW: Convert CR/LF to LF in tag signatures
On Windows, gpg outputs CR/LF signatures. But since the tag messages are already stripped of the CR by stripspace(), it is arguably nicer to do the same for the tag signature. Actually, this patch does not look for CR/LF, but strips all CRs from the signature. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -229,6 +229,20 @@ static ssize_t do_sign(char *buffer, size_t size, size_t max)
|
||||
if (len == max - size)
|
||||
return error("could not read the entire signature from gpg.");
|
||||
|
||||
#ifdef __MINGW32__
|
||||
/* strip CR from the line endings */
|
||||
{
|
||||
int i, j;
|
||||
for (i = j = 0; i < len; i++)
|
||||
if (buffer[size + i] != '\r') {
|
||||
if (i != j)
|
||||
buffer[size + j] = buffer[size + i];
|
||||
j++;
|
||||
}
|
||||
len = j;
|
||||
}
|
||||
#endif
|
||||
|
||||
return size + len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user