To: vim-dev@vim.org Subject: Patch 6.1.437 (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.437 (extra, depends on 6.1.421) Problem: Using multi-byte functions when they are not available. Solution: Put the clipboard conversion inside an #ifdef. (Vince Negri) Also fix a pointer type mistake. (Walter Briscoe) Files: src/os_mswin.c *** ../vim61.436/src/os_mswin.c Wed Mar 26 22:21:30 2003 --- src/os_mswin.c Fri Apr 4 21:32:45 2003 *************** *** 1018,1024 **** --- 1018,1026 ---- VimClipType_t metadata = { -1, -1, -1 }; HGLOBAL hMem = NULL; char_u *str = NULL; + #if defined(FEAT_MBYTE) && defined(WIN3264) char_u *to_free = NULL; + #endif char_u *hMemStr = NULL; int str_size = 0; int maxlen; *************** *** 1103,1108 **** --- 1105,1111 ---- break; } + #if defined(FEAT_MBYTE) && defined(WIN3264) /* The text is now in the active codepage. Convert to 'encoding', * going through UCS-2. */ maxlen = MultiByteToWideChar(CP_ACP, 0, str, str_size, NULL, 0); *************** *** 1119,1124 **** --- 1122,1128 ---- to_free = str; } } + #endif } } *************** *** 1143,1149 **** --- 1147,1155 ---- if (hMemStr != NULL) GlobalUnlock(hMem); CloseClipboard(); + #if defined(FEAT_MBYTE) && defined(WIN3264) vim_free(to_free); + #endif } /* *************** *** 1154,1159 **** --- 1160,1166 ---- { char_u *str = NULL; VimClipType_t metadata; + long_u txtlen; HGLOBAL hMem = NULL; HGLOBAL hMemVim = NULL; # if defined(FEAT_MBYTE) && defined(WIN3264) *************** *** 1166,1174 **** cbd->owned = FALSE; /* Get the text to be put on the clipboard, with CR-LF. */ ! metadata.type = clip_convert_selection(&str, &metadata.txtlen, cbd); if (metadata.type < 0) return; metadata.ucslen = 0; # if defined(FEAT_MBYTE) && defined(WIN3264) --- 1173,1182 ---- cbd->owned = FALSE; /* Get the text to be put on the clipboard, with CR-LF. */ ! metadata.type = clip_convert_selection(&str, &txtlen, cbd); if (metadata.type < 0) return; + metadata.txtlen = (int)txtlen; metadata.ucslen = 0; # if defined(FEAT_MBYTE) && defined(WIN3264) *** ../vim61.436/src/version.c Sun Apr 6 14:21:15 2003 --- src/version.c Sun Apr 6 14:25:20 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 437, /**/ -- It's not hard to meet expenses, they're everywhere. /// 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 ///