updated for version 7.4b.022 v7.4b.022
authorBram Moolenaar <Bram@vim.org>
Sat, 10 Aug 2013 10:45:09 +0000 (12:45 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 10 Aug 2013 10:45:09 +0000 (12:45 +0200)
Problem:    Not waiting for a character when the tick count overflows.
Solution:   Subtract the unsigned numbers and cast to int. (Ken Takata)

src/os_win32.c
src/version.c

index 48cc4c5dc01c5dd6489bb7d7901359a2aa6a6197..4013353cf3b74d6d75e11de2d58330abcd5d4c70 100644 (file)
@@ -1357,9 +1357,10 @@ WaitForChar(long msec)
 
        if (msec > 0)
        {
-           /* If the specified wait time has passed, return. */
+           /* If the specified wait time has passed, return.  Beware that
+            * GetTickCount() may wrap around (overflow). */
            dwNow = GetTickCount();
-           if (dwNow >= dwEndTime)
+           if ((int)(dwNow - dwEndTime) >= 0)
                break;
        }
        if (msec != 0)
index 59476e5233bbad2914ed01934afd29549e8b746e..f02bf3552111507754ea493fda38521e69181dda 100644 (file)
@@ -727,6 +727,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    22,
 /**/
     21,
 /**/