From 0fd6be77de6c1570bd320fc89ba82b7018ac29ae Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 23 Oct 2018 21:42:59 +0200 Subject: [PATCH] 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) --- src/terminal.c | 7 ++++++- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) 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) diff --git a/src/version.c b/src/version.c index a34837bb2..ad9b575d0 100644 --- a/src/version.c +++ b/src/version.c @@ -792,6 +792,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 491, /**/ 490, /**/ -- 2.40.0