To: vim-dev@vim.org Subject: Patch 6.1.274 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.274 (depends on 6.1.210) Problem: Resetting the iconv() state after each error is wrong for an incomplete sequence. Solution: Don't reset the iconv() state. Files: src/fileio.c *** ../vim61.273/src/fileio.c Sun Oct 27 19:31:44 2002 --- src/fileio.c Sun Jan 5 13:39:00 2003 *************** *** 1199,1205 **** char *top; size_t from_size; size_t to_size; - size_t ret; fromp = (char *)ptr; from_size = size; --- 1200,1205 ---- *************** *** 1211,1221 **** * If there is conversion error or not enough room try using * another conversion. */ ! ret = iconv(iconv_fd, &fromp, &from_size, &top, &to_size); ! if (ret == (size_t)-1) ! /* need to reset the state after an error */ ! (void)iconv(iconv_fd, NULL, NULL, NULL, NULL); ! if ((ret == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL) || from_size > CONV_RESTLEN) goto rewind_retry; --- 1211,1218 ---- * If there is conversion error or not enough room try using * another conversion. */ ! if ((iconv(iconv_fd, &fromp, &from_size, &top, &to_size) ! == (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL) || from_size > CONV_RESTLEN) goto rewind_retry; *** ../vim61.273/src/version.c Sun Jan 5 13:32:45 2003 --- src/version.c Sun Jan 5 13:40:59 2003 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 274, /**/ -- Not too long ago, a program was something you watched on TV... /// 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 /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///