diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-10-23 21:42:59 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-10-23 21:42:59 +0200 |
commit | 0fd6be77de6c1570bd320fc89ba82b7018ac29ae (patch) | |
tree | ef9bde854be5446b37de6fa22a83f12fa9bdf211 /src/terminal.c | |
parent | eda9e9c2fe4577ad451418253b990a3f60b70444 (diff) | |
download | vim-git-0fd6be77de6c1570bd320fc89ba82b7018ac29ae.tar.gz |
patch 8.1.0491: if a terminal dump has CR it is considered corruptv8.1.0491
Problem: If a terminal dump has CR it is considered corrupt.
Solution: Ignore CR characters. (Nobuhiro Takasaki, closes #3558)
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c index 4e62253d5..6927d6902 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -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) |