# HG changeset patch # User Bram Moolenaar # Date 1376131509 -7200 # Node ID d5d6b78cff090e87d52924179e44131b5ba7436d # Parent 908959a56382f94ff7fa2b5e4b777e1aa296bd0c updated for version 7.4b.022 Problem: Not waiting for a character when the tick count overflows. Solution: Subtract the unsigned numbers and cast to int. (Ken Takata) diff --git a/src/os_win32.c b/src/os_win32.c --- a/src/os_win32.c +++ b/src/os_win32.c @@ -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) diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -728,6 +728,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 22, +/**/ 21, /**/ 20,