To: vim_dev@googlegroups.com Subject: Patch 8.0.1230 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1230 Problem: CTRL-A in Visual mode uses character after selection. (Nikolai Pavlov) Solution: Check the length before using a character. Files: src/charset.c *** ../vim-8.0.1229/src/charset.c 2017-10-28 15:38:35.403474381 +0200 --- src/charset.c 2017-10-28 16:07:07.199752812 +0200 *************** *** 1852,1858 **** * If "what" contains STR2NR_OCT recognize octal numbers * If "what" contains STR2NR_HEX recognize hex numbers * If "what" contains STR2NR_FORCE always assume bin/oct/hex. ! * If maxlen > 0, check at a maximum maxlen chars */ void vim_str2nr( --- 1852,1858 ---- * If "what" contains STR2NR_OCT recognize octal numbers * If "what" contains STR2NR_HEX recognize hex numbers * If "what" contains STR2NR_FORCE always assume bin/oct/hex. ! * If maxlen > 0, check at a maximum maxlen chars. */ void vim_str2nr( *************** *** 1900,1906 **** if (what & STR2NR_OCT) { /* Don't interpret "0", "08" or "0129" as octal. */ ! for (n = 1; VIM_ISDIGIT(ptr[n]); ++n) { if (ptr[n] > '7') { --- 1900,1906 ---- if (what & STR2NR_OCT) { /* Don't interpret "0", "08" or "0129" as octal. */ ! for (n = 1; n != maxlen && VIM_ISDIGIT(ptr[n]); ++n) { if (ptr[n] > '7') { *************** *** 1908,1915 **** break; } pre = '0'; /* assume octal */ - if (n == maxlen) - break; } } } --- 1908,1913 ---- *** ../vim-8.0.1229/src/version.c 2017-10-28 15:38:35.403474381 +0200 --- src/version.c 2017-10-28 15:56:25.480148183 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1230, /**/ -- TIM: Too late. ARTHUR: What? TIM: There he is! [They all turn, and see a large white RABBIT lollop a few yards out of the cave. Accompanied by terrifying chord and jarring metallic monster noise.] "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///