changeset 7549:b80fb2cfd62b v7.4.1075

commit https://github.com/vim/vim/commit/05fe017c1ac0503b706dad695097572fde01ab0b Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 10 13:54:48 2016 +0100 patch 7.4.1075 Problem: Crash when using an invalid command. Solution: Fix generating the error message. (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Sun, 10 Jan 2016 14:00:04 +0100
parents 77aac880d9e8
children a38a2da9e741
files src/ex_docmd.c src/version.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -6916,6 +6916,7 @@ parse_addr_type_arg(value, vallen, argt,
     int		*addr_type_arg;
 {
     int	    i, a, b;
+
     for (i = 0; addr_type_complete[i].expand != -1; ++i)
     {
 	a = (int)STRLEN(addr_type_complete[i].name) == vallen;
@@ -6930,7 +6931,9 @@ parse_addr_type_arg(value, vallen, argt,
     if (addr_type_complete[i].expand == -1)
     {
 	char_u	*err = value;
-	for (i=0; err[i] == NUL || !vim_iswhite(err[i]); i++);
+
+	for (i = 0; err[i] != NUL && !vim_iswhite(err[i]); i++)
+	    ;
 	err[i] = NUL;
 	EMSG2(_("E180: Invalid address type value: %s"), err);
 	return FAIL;
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1075,
+/**/
     1074,
 /**/
     1073,