mirror of
https://git.proxmox.com/git/libgit2
synced 2025-10-18 19:14:55 +00:00
Repository: Fixed a bug in read_gitfile (proprely remove trailings newlines)
This commit is contained in:
parent
9d9bab5c38
commit
8b05e78018
@ -409,8 +409,8 @@ static int read_gitfile(char *path_out, size_t size, const char *file_path, cons
|
||||
|
||||
end_offset = strlen(data) - 1;
|
||||
|
||||
for (;data[end_offset] != '\r' && data[end_offset] != '\n'; --end_offset);
|
||||
data[end_offset] = '\0';
|
||||
for (;data[end_offset] == '\r' || data[end_offset] == '\n'; --end_offset);
|
||||
data[end_offset + 1] = '\0';
|
||||
|
||||
if (GIT_FILE_CONTENT_PREFIX_LENGTH == end_offset) {
|
||||
gitfo_free_buf(&file);
|
||||
|
Loading…
Reference in New Issue
Block a user