summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-23 21:42:59 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-23 21:42:59 +0200
commit0fd6be77de6c1570bd320fc89ba82b7018ac29ae (patch)
treeef9bde854be5446b37de6fa22a83f12fa9bdf211 /src/terminal.c
parenteda9e9c2fe4577ad451418253b990a3f60b70444 (diff)
downloadvim-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.c7
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)