Skip to content

Commit ce15775

Browse files
committed
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.
1 parent 9a91c7a commit ce15775

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/charset.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ vim_isblankline(char_u *lbuf)
18521852
* If "what" contains STR2NR_OCT recognize octal numbers
18531853
* If "what" contains STR2NR_HEX recognize hex numbers
18541854
* If "what" contains STR2NR_FORCE always assume bin/oct/hex.
1855-
* If maxlen > 0, check at a maximum maxlen chars
1855+
* If maxlen > 0, check at a maximum maxlen chars.
18561856
*/
18571857
void
18581858
vim_str2nr(
@@ -1900,16 +1900,14 @@ vim_str2nr(
19001900
if (what & STR2NR_OCT)
19011901
{
19021902
/* Don't interpret "0", "08" or "0129" as octal. */
1903-
for (n = 1; VIM_ISDIGIT(ptr[n]); ++n)
1903+
for (n = 1; n != maxlen && VIM_ISDIGIT(ptr[n]); ++n)
19041904
{
19051905
if (ptr[n] > '7')
19061906
{
19071907
pre = 0; /* can't be octal */
19081908
break;
19091909
}
19101910
pre = '0'; /* assume octal */
1911-
if (n == maxlen)
1912-
break;
19131911
}
19141912
}
19151913
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1230,
764766
/**/
765767
1229,
766768
/**/

0 commit comments

Comments
 (0)