]> granicus.if.org Git - vim/commitdiff
patch 8.1.0491: if a terminal dump has CR it is considered corrupt v8.1.0491
authorBram Moolenaar <Bram@vim.org>
Tue, 23 Oct 2018 19:42:59 +0000 (21:42 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 23 Oct 2018 19:42:59 +0000 (21:42 +0200)
Problem:    If a terminal dump has CR it is considered corrupt.
Solution:   Ignore CR characters. (Nobuhiro Takasaki, closes #3558)

src/terminal.c
src/version.c

index 4e62253d5476ea00db3d88ef313d2677b2bd295c..6927d690212eebd4eb0925351d75346f5e636b32 100644 (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)
index a34837bb2704d0b93edd5fef690486bcc89bbd3f..ad9b575d02eb4993653a8beb2d76aca0acf267b6 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    491,
 /**/
     490,
 /**/