To: vim_dev@googlegroups.com Subject: Patch 8.2.4418 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4418 Problem: Crash when using special multi-byte character. Solution: Don't use isalpha() for an arbitrary character. Files: src/charset.c, src/proto/charset.pro, src/filepath.c, src/testdir/test_autochdir.vim *** ../vim-8.2.4417/src/charset.c 2022-02-16 19:24:03.618162413 +0000 --- src/charset.c 2022-02-19 10:52:13.352240981 +0000 *************** *** 1645,1650 **** --- 1645,1656 ---- } int + vim_isalpha(int c) + { + return vim_islower(c) || vim_isupper(c); + } + + int vim_toupper(int c) { if (c <= '@') *** ../vim-8.2.4417/src/proto/charset.pro 2021-12-15 15:41:41.085254846 +0000 --- src/proto/charset.pro 2022-02-19 10:53:14.864057454 +0000 *************** *** 50,55 **** --- 50,56 ---- int vim_isbdigit(int c); int vim_islower(int c); int vim_isupper(int c); + int vim_isalpha(int c); int vim_toupper(int c); int vim_tolower(int c); char_u *skiptowhite(char_u *p); *************** *** 63,67 **** int rem_backslash(char_u *str); void backslash_halve(char_u *p); char_u *backslash_halve_save(char_u *p); - void ebcdic2ascii(char_u *buffer, int len); /* vim: set ft=c : */ --- 64,67 ---- *** ../vim-8.2.4417/src/filepath.c 2022-02-09 15:20:35.271193736 +0000 --- src/filepath.c 2022-02-19 11:17:43.013737793 +0000 *************** *** 3626,3632 **** else if (path_end >= path + wildoff && (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL || (!p_fic && (flags & EW_ICASE) ! && isalpha(PTR2CHAR(path_end))))) e = p; if (has_mbyte) { --- 3626,3632 ---- else if (path_end >= path + wildoff && (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL || (!p_fic && (flags & EW_ICASE) ! && vim_isalpha(PTR2CHAR(path_end))))) e = p; if (has_mbyte) { *** ../vim-8.2.4417/src/testdir/test_autochdir.vim 2021-12-28 13:15:02.444896152 +0000 --- src/testdir/test_autochdir.vim 2022-02-19 11:18:59.561769305 +0000 *************** *** 110,113 **** --- 110,121 ---- call delete('Xautodir', 'rf') endfunc + func Test_multibyte() + " using an invalid character should not cause a crash + set wic + call assert_fails('tc *', 'E344:') + set nowic + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4417/src/version.c 2022-02-18 18:34:41.284976314 +0000 --- src/version.c 2022-02-19 11:18:01.489747221 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4418, /**/ -- hundred-and-one symptoms of being an internet addict: 74. Your most erotic dreams are about cybersex /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///