Permalink
Browse files

patch 8.0.1230: CTRL-A in Visual mode uses character after selection

Problem:    CTRL-A in Visual mode uses character after selection. (Nikolai
            Pavlov)
Solution:   Check the length before using a character.
  • Loading branch information...
brammool committed Oct 28, 2017
1 parent 9a91c7a commit ce1577502693940f1f9285cd803a075b738a2330
Showing with 4 additions and 4 deletions.
  1. +2 −4 src/charset.c
  2. +2 −0 src/version.c
View
@@ -1852,7 +1852,7 @@ vim_isblankline(char_u *lbuf)
* 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
* If maxlen > 0, check at a maximum maxlen chars.
*/
void
vim_str2nr(
@@ -1900,16 +1900,14 @@ vim_str2nr(
if (what & STR2NR_OCT)
{
/* Don't interpret "0", "08" or "0129" as octal. */
for (n = 1; VIM_ISDIGIT(ptr[n]); ++n)
for (n = 1; n != maxlen && VIM_ISDIGIT(ptr[n]); ++n)
{
if (ptr[n] > '7')
{
pre = 0; /* can't be octal */
break;
}
pre = '0'; /* assume octal */
if (n == maxlen)
break;
}
}
}
View
@@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1230,
/**/
1229,
/**/

0 comments on commit ce15775

Please sign in to comment.