To: vim_dev@googlegroups.com Subject: Patch 8.2.5120 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5120 Problem: Searching for quotes may go over the end of the line. Solution: Check for running into the NUL. Files: src/textobject.c *** ../vim-8.2.5119/src/textobject.c 2022-05-24 11:49:27.910175908 +0100 --- src/textobject.c 2022-06-18 11:08:46.904519277 +0100 *************** *** 1798,1808 **** --- 1798,1814 ---- // Find out if we have a quote in the selection. while (i <= col_end) + { + // check for going over the end of the line, which can happen if + // the line was changed after the Visual area was selected. + if (line[i] == NUL) + break; if (line[i++] == quotechar) { selected_quote = TRUE; break; } + } } if (!vis_empty && line[col_start] == quotechar) *** ../vim-8.2.5119/src/version.c 2022-06-17 21:27:32.731699915 +0100 --- src/version.c 2022-06-18 11:21:00.410997833 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5120, /**/ -- "I thought there was something different. You no longer smell of excrement. It suits you!" -- the Outpost /// 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 ///