vim-patch:7.4.617

Problem:    Wrong ":argdo" range does not cause an error.
Solution:   Reset "cmd" to NULL. (Marcin Szamotulski, Ingo Karkat)

c0a37b9db3
This commit is contained in:
Shougo Matsushita
2015-11-29 16:15:27 +09:00
parent a03af86cc2
commit cff1e9e0b6
2 changed files with 8 additions and 3 deletions

View File

@@ -3446,6 +3446,7 @@ static linenr_T get_address(char_u **ptr,
}
if (addr_type != ADDR_LINES) {
EMSG(_(e_invaddr));
cmd = NULL;
goto error;
}
if (skip)
@@ -3473,6 +3474,7 @@ static linenr_T get_address(char_u **ptr,
c = *cmd++;
if (addr_type != ADDR_LINES) {
EMSG(_(e_invaddr));
cmd = NULL;
goto error;
}
if (skip) { /* skip "/pat/" */
@@ -3516,6 +3518,7 @@ static linenr_T get_address(char_u **ptr,
++cmd;
if (addr_type != ADDR_LINES) {
EMSG(_(e_invaddr));
cmd = NULL;
goto error;
}
if (*cmd == '&')
@@ -3587,7 +3590,8 @@ static linenr_T get_address(char_u **ptr,
else
n = getdigits(&cmd);
if (addr_type == ADDR_LOADED_BUFFERS || addr_type == ADDR_BUFFERS)
lnum = compute_buffer_local_count(addr_type, lnum, (i == '-') ? -1 * n : n);
lnum = compute_buffer_local_count(
addr_type, lnum, (i == '-') ? -1 * n : n);
else if (i == '-')
lnum -= n;
else
@@ -3655,7 +3659,8 @@ static char_u *invalid_range(exarg_T *eap)
}
break;
case ADDR_ARGUMENTS:
if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) { // add 1 if ARGCOUNT is 0
// add 1 if ARGCOUNT is 0
if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) {
return (char_u *)_(e_invrange);
}
break;

View File

@@ -379,7 +379,7 @@ static int included_patches[] = {
// 620,
// 619 NA
// 618 NA
// 617,
617,
// 616,
615,
// 614,