To: vim_dev@googlegroups.com Subject: Patch 8.2.0060 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0060 Problem: Message test only runs with one encoding. (Dominique Pelle) Solution: Run the test with "utf-8" and "latin1". Fix underflow. (related to #5410) Files: src/message_test.c, src/message.c *** ../vim-8.2.0059/src/message_test.c 2019-12-21 18:25:50.453560468 +0100 --- src/message_test.c 2019-12-30 17:50:00.605392738 +0100 *************** *** 100,107 **** --- 100,113 ---- params.argc = argc; params.argv = argv; common_init(¶ms); + + set_option_value((char_u *)"encoding", 0, (char_u *)"utf-8", 0); init_chartab(); + test_trunc_string(); + set_option_value((char_u *)"encoding", 0, (char_u *)"latin1", 0); + init_chartab(); test_trunc_string(); + return 0; } *** ../vim-8.2.0059/src/message.c 2019-12-29 23:04:20.294639884 +0100 --- src/message.c 2019-12-30 17:53:04.924922715 +0100 *************** *** 307,313 **** } else { ! for (i = (int)STRLEN(s); len + (n = ptr2cells(s + i - 1)) <= room; --i) len += n; } --- 307,314 ---- } else { ! for (i = (int)STRLEN(s); ! i - 1 >= 0 && len + (n = ptr2cells(s + i - 1)) <= room; --i) len += n; } *** ../vim-8.2.0059/src/version.c 2019-12-30 10:56:57.032237969 +0100 --- src/version.c 2019-12-30 17:51:03.397239834 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 60, /**/ -- BLACK KNIGHT: Come on you pansy! [hah] [parry thrust] [ARTHUR chops the BLACK KNIGHT's right arm off] ARTHUR: Victory is mine! [kneeling] We thank thee Lord, that in thy merc- [Black Knight kicks Arthur in the head while he is praying] The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///