vim-patch: 7.4.1075

Problem:    Crash when using an invalid command.
Solution:   Fix generating the error message. (Dominique Pelle)

05fe017c1a
This commit is contained in:
Michael Ennen 2016-04-26 23:30:34 -07:00
parent 2adb8acebd
commit 7209d3c59a
2 changed files with 6 additions and 5 deletions

View File

@ -5503,7 +5503,8 @@ int parse_addr_type_arg(char_u *value, int vallen, uint32_t *argt,
int *addr_type_arg) int *addr_type_arg)
{ {
int i, a, b; int i, a, b;
for (i = 0; addr_type_complete[i].expand != -1; ++i) {
for (i = 0; addr_type_complete[i].expand != -1; i++) {
a = (int)STRLEN(addr_type_complete[i].name) == vallen; a = (int)STRLEN(addr_type_complete[i].name) == vallen;
b = STRNCMP(value, addr_type_complete[i].name, vallen) == 0; b = STRNCMP(value, addr_type_complete[i].name, vallen) == 0;
if (a && b) { if (a && b) {
@ -5514,8 +5515,8 @@ int parse_addr_type_arg(char_u *value, int vallen, uint32_t *argt,
if (addr_type_complete[i].expand == -1) { if (addr_type_complete[i].expand == -1) {
char_u *err = value; char_u *err = value;
for (i = 0; err[i] == NUL || !ascii_iswhite(err[i]); i++)
; for (i = 0; err[i] != NUL && !ascii_iswhite(err[i]); i++) {}
err[i] = NUL; err[i] = NUL;
EMSG2(_("E180: Invalid address type value: %s"), err); EMSG2(_("E180: Invalid address type value: %s"), err);
return FAIL; return FAIL;

View File

@ -602,8 +602,8 @@ static int included_patches[] = {
// 1078 NA // 1078 NA
// 1077 NA // 1077 NA
1076, 1076,
// 1075, 1075,
// 1074 NA // 1074 NA,
// 1073, // 1073,
1072, 1072,
// 1071, // 1071,