To: vim-dev@vim.org Subject: Patch 6.1.456 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.456 (extra, after 6.1.454) Problem: Win32: IME doesn't work. Solution: ImmGetCompositionStringW() returns the size in bytes, not words. (Yasuhiro Matsumoto) Also fix typecast problem. Files: src/gui_w32.c, src/os_mswin.c *** ../vim61.455/src/gui_w32.c Thu Apr 10 22:38:13 2003 --- src/gui_w32.c Fri Apr 11 11:27:47 2003 *************** *** 1313,1323 **** if (ret > 0) { ! wbuf = (LPWSTR)alloc(ret * sizeof(WCHAR)); if (wbuf != NULL) { pImmGetCompositionStringW(hIMC, GCS, wbuf, ret); ! *lenp = ret; } return (short_u *)wbuf; } --- 1313,1324 ---- if (ret > 0) { ! /* Allocate the requested buffer plus space for the NUL character. */ ! wbuf = (LPWSTR)alloc(ret + sizeof(WCHAR)); if (wbuf != NULL) { pImmGetCompositionStringW(hIMC, GCS, wbuf, ret); ! *lenp = ret / sizeof(WCHAR); } return (short_u *)wbuf; } *** ../vim61.455/src/os_mswin.c Thu Apr 10 22:38:13 2003 --- src/os_mswin.c Fri Apr 11 10:54:36 2003 *************** *** 1127,1133 **** /* The text is in the active codepage. Convert to 'encoding', * going through UCS-2. */ MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, ! &(LPWSTR)to_free, &maxlen); if (to_free != NULL) { str_size = maxlen; --- 1169,1175 ---- /* The text is in the active codepage. Convert to 'encoding', * going through UCS-2. */ MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, ! (LPWSTR *)&to_free, &maxlen); if (to_free != NULL) { str_size = maxlen; *** ../vim61.455/src/version.c Thu Apr 10 22:58:43 2003 --- src/version.c Sun Apr 13 17:14:06 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 456, /**/ -- CART DRIVER: Bring out your dead! There are legs stick out of windows and doors. Two MEN are fighting in the mud - covered from head to foot in it. Another MAN is on his hands in knees shovelling mud into his mouth. We just catch sight of a MAN falling into a well. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///