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

View File

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