3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.600
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.600
3ef2ca
Problem:    Memory wasted in struct because of aligning.
3ef2ca
Solution:   Split pos in lnum and col. (Dominique Pelle)
3ef2ca
Files:	    src/regexp_nfa.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.599/src/regexp_nfa.c	2015-01-27 14:39:55.661913204 +0100
3ef2ca
--- src/regexp_nfa.c	2015-01-27 14:43:04.323847916 +0100
3ef2ca
***************
3ef2ca
*** 1456,1462 ****
3ef2ca
  			 * matched an unlimited number of times. NFA_NOPEN is
3ef2ca
  			 * added only once at a position, while NFA_SPLIT is
3ef2ca
  			 * added multiple times.  This is more efficient than
3ef2ca
! 			 * not allowsing NFA_SPLIT multiple times, it is used
3ef2ca
  			 * a lot. */
3ef2ca
  			EMIT(NFA_NOPEN);
3ef2ca
  			break;
3ef2ca
--- 1456,1462 ----
3ef2ca
  			 * matched an unlimited number of times. NFA_NOPEN is
3ef2ca
  			 * added only once at a position, while NFA_SPLIT is
3ef2ca
  			 * added multiple times.  This is more efficient than
3ef2ca
! 			 * not allowing NFA_SPLIT multiple times, it is used
3ef2ca
  			 * a lot. */
3ef2ca
  			EMIT(NFA_NOPEN);
3ef2ca
  			break;
3ef2ca
***************
3ef2ca
*** 3726,3733 ****
3ef2ca
      {
3ef2ca
  	struct multipos
3ef2ca
  	{
3ef2ca
! 	    lpos_T	start;
3ef2ca
! 	    lpos_T	end;
3ef2ca
  	} multi[NSUBEXP];
3ef2ca
  	struct linepos
3ef2ca
  	{
3ef2ca
--- 3726,3735 ----
3ef2ca
      {
3ef2ca
  	struct multipos
3ef2ca
  	{
3ef2ca
! 	    linenr_T	start_lnum;
3ef2ca
! 	    linenr_T	end_lnum;
3ef2ca
! 	    colnr_T	start_col;
3ef2ca
! 	    colnr_T	end_col;
3ef2ca
  	} multi[NSUBEXP];
3ef2ca
  	struct linepos
3ef2ca
  	{
3ef2ca
***************
3ef2ca
*** 3812,3821 ****
3ef2ca
  	if (REG_MULTI)
3ef2ca
  	    fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
3ef2ca
  		    j,
3ef2ca
! 		    sub->list.multi[j].start.col,
3ef2ca
! 		    (int)sub->list.multi[j].start.lnum,
3ef2ca
! 		    sub->list.multi[j].end.col,
3ef2ca
! 		    (int)sub->list.multi[j].end.lnum);
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    char *s = (char *)sub->list.line[j].start;
3ef2ca
--- 3814,3823 ----
3ef2ca
  	if (REG_MULTI)
3ef2ca
  	    fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
3ef2ca
  		    j,
3ef2ca
! 		    sub->list.multi[j].start_col,
3ef2ca
! 		    (int)sub->list.multi[j].start_lnum,
3ef2ca
! 		    sub->list.multi[j].end_col,
3ef2ca
! 		    (int)sub->list.multi[j].end_lnum);
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    char *s = (char *)sub->list.line[j].start;
3ef2ca
***************
3ef2ca
*** 3952,3959 ****
3ef2ca
      {
3ef2ca
  	if (REG_MULTI)
3ef2ca
  	{
3ef2ca
! 	    if (from->list.multi[0].end.lnum >= 0)
3ef2ca
! 		to->list.multi[0].end = from->list.multi[0].end;
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
--- 3954,3964 ----
3ef2ca
      {
3ef2ca
  	if (REG_MULTI)
3ef2ca
  	{
3ef2ca
! 	    if (from->list.multi[0].end_lnum >= 0)
3ef2ca
!             {
3ef2ca
! 		to->list.multi[0].end_lnum = from->list.multi[0].end_lnum;
3ef2ca
! 		to->list.multi[0].end_col = from->list.multi[0].end_col;
3ef2ca
!             }
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
***************
3ef2ca
*** 3985,4017 ****
3ef2ca
  	for (i = 0; i < todo; ++i)
3ef2ca
  	{
3ef2ca
  	    if (i < sub1->in_use)
3ef2ca
! 		s1 = sub1->list.multi[i].start.lnum;
3ef2ca
  	    else
3ef2ca
  		s1 = -1;
3ef2ca
  	    if (i < sub2->in_use)
3ef2ca
! 		s2 = sub2->list.multi[i].start.lnum;
3ef2ca
  	    else
3ef2ca
  		s2 = -1;
3ef2ca
  	    if (s1 != s2)
3ef2ca
  		return FALSE;
3ef2ca
! 	    if (s1 != -1 && sub1->list.multi[i].start.col
3ef2ca
! 					     != sub2->list.multi[i].start.col)
3ef2ca
  		return FALSE;
3ef2ca
  
3ef2ca
  	    if (nfa_has_backref)
3ef2ca
  	    {
3ef2ca
  		if (i < sub1->in_use)
3ef2ca
! 		    s1 = sub1->list.multi[i].end.lnum;
3ef2ca
  		else
3ef2ca
  		    s1 = -1;
3ef2ca
  		if (i < sub2->in_use)
3ef2ca
! 		    s2 = sub2->list.multi[i].end.lnum;
3ef2ca
  		else
3ef2ca
  		    s2 = -1;
3ef2ca
  		if (s1 != s2)
3ef2ca
  		    return FALSE;
3ef2ca
! 		if (s1 != -1 && sub1->list.multi[i].end.col
3ef2ca
! 					       != sub2->list.multi[i].end.col)
3ef2ca
  		return FALSE;
3ef2ca
  	    }
3ef2ca
  	}
3ef2ca
--- 3990,4022 ----
3ef2ca
  	for (i = 0; i < todo; ++i)
3ef2ca
  	{
3ef2ca
  	    if (i < sub1->in_use)
3ef2ca
! 		s1 = sub1->list.multi[i].start_lnum;
3ef2ca
  	    else
3ef2ca
  		s1 = -1;
3ef2ca
  	    if (i < sub2->in_use)
3ef2ca
! 		s2 = sub2->list.multi[i].start_lnum;
3ef2ca
  	    else
3ef2ca
  		s2 = -1;
3ef2ca
  	    if (s1 != s2)
3ef2ca
  		return FALSE;
3ef2ca
! 	    if (s1 != -1 && sub1->list.multi[i].start_col
3ef2ca
! 					     != sub2->list.multi[i].start_col)
3ef2ca
  		return FALSE;
3ef2ca
  
3ef2ca
  	    if (nfa_has_backref)
3ef2ca
  	    {
3ef2ca
  		if (i < sub1->in_use)
3ef2ca
! 		    s1 = sub1->list.multi[i].end_lnum;
3ef2ca
  		else
3ef2ca
  		    s1 = -1;
3ef2ca
  		if (i < sub2->in_use)
3ef2ca
! 		    s2 = sub2->list.multi[i].end_lnum;
3ef2ca
  		else
3ef2ca
  		    s2 = -1;
3ef2ca
  		if (s1 != s2)
3ef2ca
  		    return FALSE;
3ef2ca
! 		if (s1 != -1 && sub1->list.multi[i].end_col
3ef2ca
! 					       != sub2->list.multi[i].end_col)
3ef2ca
  		return FALSE;
3ef2ca
  	    }
3ef2ca
  	}
3ef2ca
***************
3ef2ca
*** 4062,4068 ****
3ef2ca
      if (sub->in_use <= 0)
3ef2ca
  	col = -1;
3ef2ca
      else if (REG_MULTI)
3ef2ca
! 	col = sub->list.multi[0].start.col;
3ef2ca
      else
3ef2ca
  	col = (int)(sub->list.line[0].start - regline);
3ef2ca
      nfa_set_code(state->c);
3ef2ca
--- 4067,4073 ----
3ef2ca
      if (sub->in_use <= 0)
3ef2ca
  	col = -1;
3ef2ca
      else if (REG_MULTI)
3ef2ca
! 	col = sub->list.multi[0].start_col;
3ef2ca
      else
3ef2ca
  	col = (int)(sub->list.line[0].start - regline);
3ef2ca
      nfa_set_code(state->c);
3ef2ca
***************
3ef2ca
*** 4482,4488 ****
3ef2ca
  	    {
3ef2ca
  		if (subidx < sub->in_use)
3ef2ca
  		{
3ef2ca
! 		    save_lpos = sub->list.multi[subidx].start;
3ef2ca
  		    save_in_use = -1;
3ef2ca
  		}
3ef2ca
  		else
3ef2ca
--- 4487,4494 ----
3ef2ca
  	    {
3ef2ca
  		if (subidx < sub->in_use)
3ef2ca
  		{
3ef2ca
! 		    save_lpos.lnum = sub->list.multi[subidx].start_lnum;
3ef2ca
! 		    save_lpos.col = sub->list.multi[subidx].start_col;
3ef2ca
  		    save_in_use = -1;
3ef2ca
  		}
3ef2ca
  		else
3ef2ca
***************
3ef2ca
*** 4490,4509 ****
3ef2ca
  		    save_in_use = sub->in_use;
3ef2ca
  		    for (i = sub->in_use; i < subidx; ++i)
3ef2ca
  		    {
3ef2ca
! 			sub->list.multi[i].start.lnum = -1;
3ef2ca
! 			sub->list.multi[i].end.lnum = -1;
3ef2ca
  		    }
3ef2ca
  		    sub->in_use = subidx + 1;
3ef2ca
  		}
3ef2ca
  		if (off == -1)
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].start.lnum = reglnum + 1;
3ef2ca
! 		    sub->list.multi[subidx].start.col = 0;
3ef2ca
  		}
3ef2ca
  		else
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].start.lnum = reglnum;
3ef2ca
! 		    sub->list.multi[subidx].start.col =
3ef2ca
  					  (colnr_T)(reginput - regline + off);
3ef2ca
  		}
3ef2ca
  	    }
3ef2ca
--- 4496,4515 ----
3ef2ca
  		    save_in_use = sub->in_use;
3ef2ca
  		    for (i = sub->in_use; i < subidx; ++i)
3ef2ca
  		    {
3ef2ca
! 			sub->list.multi[i].start_lnum = -1;
3ef2ca
! 			sub->list.multi[i].end_lnum = -1;
3ef2ca
  		    }
3ef2ca
  		    sub->in_use = subidx + 1;
3ef2ca
  		}
3ef2ca
  		if (off == -1)
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].start_lnum = reglnum + 1;
3ef2ca
! 		    sub->list.multi[subidx].start_col = 0;
3ef2ca
  		}
3ef2ca
  		else
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].start_lnum = reglnum;
3ef2ca
! 		    sub->list.multi[subidx].start_col =
3ef2ca
  					  (colnr_T)(reginput - regline + off);
3ef2ca
  		}
3ef2ca
  	    }
3ef2ca
***************
3ef2ca
*** 4539,4545 ****
3ef2ca
  	    if (save_in_use == -1)
3ef2ca
  	    {
3ef2ca
  		if (REG_MULTI)
3ef2ca
! 		    sub->list.multi[subidx].start = save_lpos;
3ef2ca
  		else
3ef2ca
  		    sub->list.line[subidx].start = save_ptr;
3ef2ca
  	    }
3ef2ca
--- 4545,4554 ----
3ef2ca
  	    if (save_in_use == -1)
3ef2ca
  	    {
3ef2ca
  		if (REG_MULTI)
3ef2ca
!                 {
3ef2ca
! 		    sub->list.multi[subidx].start_lnum = save_lpos.lnum;
3ef2ca
! 		    sub->list.multi[subidx].start_col = save_lpos.col;
3ef2ca
!                 }
3ef2ca
  		else
3ef2ca
  		    sub->list.line[subidx].start = save_ptr;
3ef2ca
  	    }
3ef2ca
***************
3ef2ca
*** 4549,4555 ****
3ef2ca
  
3ef2ca
  	case NFA_MCLOSE:
3ef2ca
  	    if (nfa_has_zend && (REG_MULTI
3ef2ca
! 			? subs->norm.list.multi[0].end.lnum >= 0
3ef2ca
  			: subs->norm.list.line[0].end != NULL))
3ef2ca
  	    {
3ef2ca
  		/* Do not overwrite the position set by \ze. */
3ef2ca
--- 4558,4564 ----
3ef2ca
  
3ef2ca
  	case NFA_MCLOSE:
3ef2ca
  	    if (nfa_has_zend && (REG_MULTI
3ef2ca
! 			? subs->norm.list.multi[0].end_lnum >= 0
3ef2ca
  			: subs->norm.list.line[0].end != NULL))
3ef2ca
  	    {
3ef2ca
  		/* Do not overwrite the position set by \ze. */
3ef2ca
***************
3ef2ca
*** 4603,4618 ****
3ef2ca
  		sub->in_use = subidx + 1;
3ef2ca
  	    if (REG_MULTI)
3ef2ca
  	    {
3ef2ca
! 		save_lpos = sub->list.multi[subidx].end;
3ef2ca
  		if (off == -1)
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].end.lnum = reglnum + 1;
3ef2ca
! 		    sub->list.multi[subidx].end.col = 0;
3ef2ca
  		}
3ef2ca
  		else
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].end.lnum = reglnum;
3ef2ca
! 		    sub->list.multi[subidx].end.col =
3ef2ca
  					  (colnr_T)(reginput - regline + off);
3ef2ca
  		}
3ef2ca
  		/* avoid compiler warnings */
3ef2ca
--- 4612,4628 ----
3ef2ca
  		sub->in_use = subidx + 1;
3ef2ca
  	    if (REG_MULTI)
3ef2ca
  	    {
3ef2ca
! 		save_lpos.lnum = sub->list.multi[subidx].end_lnum;
3ef2ca
! 		save_lpos.col = sub->list.multi[subidx].end_col;
3ef2ca
  		if (off == -1)
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].end_lnum = reglnum + 1;
3ef2ca
! 		    sub->list.multi[subidx].end_col = 0;
3ef2ca
  		}
3ef2ca
  		else
3ef2ca
  		{
3ef2ca
! 		    sub->list.multi[subidx].end_lnum = reglnum;
3ef2ca
! 		    sub->list.multi[subidx].end_col =
3ef2ca
  					  (colnr_T)(reginput - regline + off);
3ef2ca
  		}
3ef2ca
  		/* avoid compiler warnings */
3ef2ca
***************
3ef2ca
*** 4637,4643 ****
3ef2ca
  		sub = &subs->norm;
3ef2ca
  
3ef2ca
  	    if (REG_MULTI)
3ef2ca
! 		sub->list.multi[subidx].end = save_lpos;
3ef2ca
  	    else
3ef2ca
  		sub->list.line[subidx].end = save_ptr;
3ef2ca
  	    sub->in_use = save_in_use;
3ef2ca
--- 4647,4656 ----
3ef2ca
  		sub = &subs->norm;
3ef2ca
  
3ef2ca
  	    if (REG_MULTI)
3ef2ca
!             {
3ef2ca
! 		sub->list.multi[subidx].end_lnum = save_lpos.lnum;
3ef2ca
! 		sub->list.multi[subidx].end_col = save_lpos.col;
3ef2ca
!             }
3ef2ca
  	    else
3ef2ca
  		sub->list.line[subidx].end = save_ptr;
3ef2ca
  	    sub->in_use = save_in_use;
3ef2ca
***************
3ef2ca
*** 4825,4839 ****
3ef2ca
  
3ef2ca
      if (REG_MULTI)
3ef2ca
      {
3ef2ca
! 	if (sub->list.multi[subidx].start.lnum < 0
3ef2ca
! 				       || sub->list.multi[subidx].end.lnum < 0)
3ef2ca
  	    goto retempty;
3ef2ca
! 	if (sub->list.multi[subidx].start.lnum == reglnum
3ef2ca
! 			       && sub->list.multi[subidx].end.lnum == reglnum)
3ef2ca
  	{
3ef2ca
! 	    len = sub->list.multi[subidx].end.col
3ef2ca
! 					  - sub->list.multi[subidx].start.col;
3ef2ca
! 	    if (cstrncmp(regline + sub->list.multi[subidx].start.col,
3ef2ca
  							 reginput, &len) == 0)
3ef2ca
  	    {
3ef2ca
  		*bytelen = len;
3ef2ca
--- 4838,4852 ----
3ef2ca
  
3ef2ca
      if (REG_MULTI)
3ef2ca
      {
3ef2ca
! 	if (sub->list.multi[subidx].start_lnum < 0
3ef2ca
! 				       || sub->list.multi[subidx].end_lnum < 0)
3ef2ca
  	    goto retempty;
3ef2ca
! 	if (sub->list.multi[subidx].start_lnum == reglnum
3ef2ca
! 			       && sub->list.multi[subidx].end_lnum == reglnum)
3ef2ca
  	{
3ef2ca
! 	    len = sub->list.multi[subidx].end_col
3ef2ca
! 					  - sub->list.multi[subidx].start_col;
3ef2ca
! 	    if (cstrncmp(regline + sub->list.multi[subidx].start_col,
3ef2ca
  							 reginput, &len) == 0)
3ef2ca
  	    {
3ef2ca
  		*bytelen = len;
3ef2ca
***************
3ef2ca
*** 4843,4852 ****
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    if (match_with_backref(
3ef2ca
! 			sub->list.multi[subidx].start.lnum,
3ef2ca
! 			sub->list.multi[subidx].start.col,
3ef2ca
! 			sub->list.multi[subidx].end.lnum,
3ef2ca
! 			sub->list.multi[subidx].end.col,
3ef2ca
  			bytelen) == RA_MATCH)
3ef2ca
  		return TRUE;
3ef2ca
  	}
3ef2ca
--- 4856,4865 ----
3ef2ca
  	else
3ef2ca
  	{
3ef2ca
  	    if (match_with_backref(
3ef2ca
! 			sub->list.multi[subidx].start_lnum,
3ef2ca
! 			sub->list.multi[subidx].start_col,
3ef2ca
! 			sub->list.multi[subidx].end_lnum,
3ef2ca
! 			sub->list.multi[subidx].end_col,
3ef2ca
  			bytelen) == RA_MATCH)
3ef2ca
  		return TRUE;
3ef2ca
  	}
3ef2ca
***************
3ef2ca
*** 5441,5446 ****
3ef2ca
--- 5454,5460 ----
3ef2ca
  
3ef2ca
      /* Allocate memory for the lists of nodes. */
3ef2ca
      size = (nstate + 1) * sizeof(nfa_thread_T);
3ef2ca
+ 
3ef2ca
      list[0].t = (nfa_thread_T *)lalloc(size, TRUE);
3ef2ca
      list[0].len = nstate + 1;
3ef2ca
      list[1].t = (nfa_thread_T *)lalloc(size, TRUE);
3ef2ca
***************
3ef2ca
*** 5482,5489 ****
3ef2ca
      {
3ef2ca
  	if (REG_MULTI)
3ef2ca
  	{
3ef2ca
! 	    m->norm.list.multi[0].start.lnum = reglnum;
3ef2ca
! 	    m->norm.list.multi[0].start.col = (colnr_T)(reginput - regline);
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	    m->norm.list.line[0].start = reginput;
3ef2ca
--- 5496,5503 ----
3ef2ca
      {
3ef2ca
  	if (REG_MULTI)
3ef2ca
  	{
3ef2ca
! 	    m->norm.list.multi[0].start_lnum = reglnum;
3ef2ca
! 	    m->norm.list.multi[0].start_col = (colnr_T)(reginput - regline);
3ef2ca
  	}
3ef2ca
  	else
3ef2ca
  	    m->norm.list.line[0].start = reginput;
3ef2ca
***************
3ef2ca
*** 5580,5586 ****
3ef2ca
  		if (t->subs.norm.in_use <= 0)
3ef2ca
  		    col = -1;
3ef2ca
  		else if (REG_MULTI)
3ef2ca
! 		    col = t->subs.norm.list.multi[0].start.col;
3ef2ca
  		else
3ef2ca
  		    col = (int)(t->subs.norm.list.line[0].start - regline);
3ef2ca
  		nfa_set_code(t->state->c);
3ef2ca
--- 5594,5600 ----
3ef2ca
  		if (t->subs.norm.in_use <= 0)
3ef2ca
  		    col = -1;
3ef2ca
  		else if (REG_MULTI)
3ef2ca
! 		    col = t->subs.norm.list.multi[0].start_col;
3ef2ca
  		else
3ef2ca
  		    col = (int)(t->subs.norm.list.line[0].start - regline);
3ef2ca
  		nfa_set_code(t->state->c);
3ef2ca
***************
3ef2ca
*** 5861,5867 ****
3ef2ca
  		     * continue with what follows. */
3ef2ca
  		    if (REG_MULTI)
3ef2ca
  			/* TODO: multi-line match */
3ef2ca
! 			bytelen = m->norm.list.multi[0].end.col
3ef2ca
  						  - (int)(reginput - regline);
3ef2ca
  		    else
3ef2ca
  			bytelen = (int)(m->norm.list.line[0].end - reginput);
3ef2ca
--- 5875,5881 ----
3ef2ca
  		     * continue with what follows. */
3ef2ca
  		    if (REG_MULTI)
3ef2ca
  			/* TODO: multi-line match */
3ef2ca
! 			bytelen = m->norm.list.multi[0].end_col
3ef2ca
  						  - (int)(reginput - regline);
3ef2ca
  		    else
3ef2ca
  			bytelen = (int)(m->norm.list.line[0].end - reginput);
3ef2ca
***************
3ef2ca
*** 6741,6747 ****
3ef2ca
  		if (add)
3ef2ca
  		{
3ef2ca
  		    if (REG_MULTI)
3ef2ca
! 			m->norm.list.multi[0].start.col =
3ef2ca
  					 (colnr_T)(reginput - regline) + clen;
3ef2ca
  		    else
3ef2ca
  			m->norm.list.line[0].start = reginput + clen;
3ef2ca
--- 6755,6761 ----
3ef2ca
  		if (add)
3ef2ca
  		{
3ef2ca
  		    if (REG_MULTI)
3ef2ca
! 			m->norm.list.multi[0].start_col =
3ef2ca
  					 (colnr_T)(reginput - regline) + clen;
3ef2ca
  		    else
3ef2ca
  			m->norm.list.line[0].start = reginput + clen;
3ef2ca
***************
3ef2ca
*** 6854,6861 ****
3ef2ca
      {
3ef2ca
  	for (i = 0; i < subs.norm.in_use; i++)
3ef2ca
  	{
3ef2ca
! 	    reg_startpos[i] = subs.norm.list.multi[i].start;
3ef2ca
! 	    reg_endpos[i] = subs.norm.list.multi[i].end;
3ef2ca
  	}
3ef2ca
  
3ef2ca
  	if (reg_startpos[0].lnum < 0)
3ef2ca
--- 6868,6878 ----
3ef2ca
      {
3ef2ca
  	for (i = 0; i < subs.norm.in_use; i++)
3ef2ca
  	{
3ef2ca
! 	    reg_startpos[i].lnum = subs.norm.list.multi[i].start_lnum;
3ef2ca
! 	    reg_startpos[i].col = subs.norm.list.multi[i].start_col;
3ef2ca
! 
3ef2ca
! 	    reg_endpos[i].lnum = subs.norm.list.multi[i].end_lnum;
3ef2ca
! 	    reg_endpos[i].col = subs.norm.list.multi[i].end_col;
3ef2ca
  	}
3ef2ca
  
3ef2ca
  	if (reg_startpos[0].lnum < 0)
3ef2ca
***************
3ef2ca
*** 6903,6915 ****
3ef2ca
  		struct multipos *mpos = &subs.synt.list.multi[i];
3ef2ca
  
3ef2ca
  		/* Only accept single line matches that are valid. */
3ef2ca
! 		if (mpos->start.lnum >= 0
3ef2ca
! 			&& mpos->start.lnum == mpos->end.lnum
3ef2ca
! 			&& mpos->end.col >= mpos->start.col)
3ef2ca
  		    re_extmatch_out->matches[i] =
3ef2ca
! 			vim_strnsave(reg_getline(mpos->start.lnum)
3ef2ca
! 							    + mpos->start.col,
3ef2ca
! 					     mpos->end.col - mpos->start.col);
3ef2ca
  	    }
3ef2ca
  	    else
3ef2ca
  	    {
3ef2ca
--- 6920,6932 ----
3ef2ca
  		struct multipos *mpos = &subs.synt.list.multi[i];
3ef2ca
  
3ef2ca
  		/* Only accept single line matches that are valid. */
3ef2ca
! 		if (mpos->start_lnum >= 0
3ef2ca
! 			&& mpos->start_lnum == mpos->end_lnum
3ef2ca
! 			&& mpos->end_col >= mpos->start_col)
3ef2ca
  		    re_extmatch_out->matches[i] =
3ef2ca
! 			vim_strnsave(reg_getline(mpos->start_lnum)
3ef2ca
! 							    + mpos->start_col,
3ef2ca
! 					     mpos->end_col - mpos->start_col);
3ef2ca
  	    }
3ef2ca
  	    else
3ef2ca
  	    {
3ef2ca
*** ../vim-7.4.599/src/version.c	2015-01-27 14:39:55.661913204 +0100
3ef2ca
--- src/version.c	2015-01-27 14:44:06.739164665 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     600,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
126. You brag to all of your friends about your date Saturday night...but
3ef2ca
     you don't tell them it was only in a chat room.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///