To: vim-dev@vim.org
Subject: Patch 6.0.153
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.153
Problem:    When using (illegal) double-byte characters and Vim syntax
	    highlighting Vim can crash. (Yasuhiro Matsumoto)
Solution:   Increase a pointer over a character instead of a byte.
Files:	    src/regexp.c


*** ../vim60.152/src/regexp.c	Tue Jan 22 17:42:37 2002
--- src/regexp.c	Mon Jan 28 14:01:09 2002
***************
*** 3904,3909 ****
--- 3904,3912 ----
  			    /* backup to last char of previous line */
  			    --reglnum;
  			    regline = reg_getline(reglnum);
+ 			    /* Just in case regrepeat() didn't count right. */
+ 			    if (regline == NULL)
+ 				return FALSE;
  			    reginput = regline + STRLEN(regline);
  			    fast_breakcheck();
  			    if (got_int || out_of_stack)
***************
*** 4158,4164 ****
  	while (count < maxcount)
  	{
  	    if (vim_isIDc(*scan) && (testval || !isdigit(*scan)))
! 		++scan;
  	    else if (*scan == NUL)
  	    {
  		if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
--- 4161,4169 ----
  	while (count < maxcount)
  	{
  	    if (vim_isIDc(*scan) && (testval || !isdigit(*scan)))
! 	    {
! 		ADVANCE_P(scan);
! 	    }
  	    else if (*scan == NUL)
  	    {
  		if (!WITH_NL(OP(p)) || reglnum == reg_maxline)
*** ../vim60.152/src/version.c	Fri Jan 25 10:05:09 2002
--- src/version.c	Mon Jan 28 13:59:07 2002
***************
*** 608,609 ****
--- 608,611 ----
  {   /* Add new patch number below this line */
+ /**/
+     153,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
87. Everyone you know asks why your phone line is always busy ...and
    you tell them to send an e-mail.

 ///  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  ///