To: vim-dev@vim.org
Subject: Patch 6.0.152
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.0.152
Problem:    strtrans() could hang on an illegal UTF-8 byte sequence.
Solution:   Skip over illegal bytes. (Yasuhiro Matsumoto)
Files:	    src/charset.c


*** ../vim60.151/src/charset.c	Mon Oct 22 12:52:35 2001
--- src/charset.c	Fri Jan 25 10:02:37 2002
***************
*** 347,353 ****
  		p += l;
  	    }
  	    else
! 		len += byte2cells(*p++);
  	}
  	res = alloc((unsigned)(len + 1));
      }
--- 347,359 ----
  		p += l;
  	    }
  	    else
! 	    {
! 		l = byte2cells(*p++);
! 		if (l > 0)
! 		    len += l;
! 		else
! 		    ++len;	/* illegal byte sequence */
! 	    }
  	}
  	res = alloc((unsigned)(len + 1));
      }
*** ../vim60.151/src/version.c	Thu Jan 24 13:47:03 2002
--- src/version.c	Fri Jan 25 10:03:55 2002
***************
*** 608,609 ****
--- 608,611 ----
  {   /* Add new patch number below this line */
+ /**/
+     152,
  /**/

-- 
Time is money.  Especially if you make clocks.

 ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
(((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///