From: Bram Moolenaar Date: Tue, 23 Oct 2018 19:42:59 +0000 (+0200) Subject: patch 8.1.0491: if a terminal dump has CR it is considered corrupt X-Git-Tag: v8.1.0491 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0fd6be77de6c1570bd320fc89ba82b7018ac29ae;p=vim 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) --- 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, /**/