changeset 6524:8ff2d1b611bf v7.4.589

updated for version 7.4.589 Problem: In the MS-Windows console Vim can't handle greek characters when encoding is utf-8. Solution: Escape K_NUL. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Tue, 20 Jan 2015 19:39:35 +0100
parents 77b840b1f7ef
children 29ab85b9d093
files src/os_win32.c src/version.c
diffstat 2 files changed, 14 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1814,18 +1814,22 @@ mch_inchar(
 		if (conv)
 		{
 		    char_u *p = typeahead + typeaheadlen;
-		    char_u *e = typeahead + TYPEAHEADLEN;
-
-		    while (*p && p < e)
+
+		    if (*p != K_NUL)
 		    {
-			if (*p == K_NUL)
+			char_u *e = typeahead + TYPEAHEADLEN;
+
+			while (*p && p < e)
 			{
+			    if (*p == K_NUL)
+			    {
+				++p;
+				mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
+				*p = 3;
+				++n;
+			    }
 			    ++p;
-			    mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
-			    *p = 3;
-			    ++n;
 			}
-			++p;
 		    }
 		}
 
--- 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 */
 /**/
+    589,
+/**/
     588,
 /**/
     587,