0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.0491: if a terminal dump has CR it is considered corrupt

Problem:    If a terminal dump has CR it is considered corrupt.
Solution:   Ignore CR characters. (Nobuhiro Takasaki, closes #3558)
This commit is contained in:
Bram Moolenaar
2018-10-23 21:42:59 +02:00
parent eda9e9c2fe
commit 0fd6be77de
2 changed files with 8 additions and 1 deletions

View File

@@ -4094,7 +4094,12 @@ read_dump_file(FILE *fd, VTermPos *cursor_pos)
{
if (c == EOF)
break;
if (c == '\n')
if (c == '\r')
{
// DOS line endings? Ignore.
c = fgetc(fd);
}
else if (c == '\n')
{
/* End of a line: append it to the buffer. */
if (ga_text.ga_data == NULL)