Commit 8b05e780 by Romain Geissler

Repository: Fixed a bug in read_gitfile (proprely remove trailings newlines)

parent 9d9bab5c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment