Karsten Hopp c9fe60
To: vim_dev@googlegroups.com
Karsten Hopp c9fe60
Subject: Patch 7.4.519
Karsten Hopp c9fe60
Fcc: outbox
Karsten Hopp c9fe60
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp c9fe60
Mime-Version: 1.0
Karsten Hopp c9fe60
Content-Type: text/plain; charset=UTF-8
Karsten Hopp c9fe60
Content-Transfer-Encoding: 8bit
Karsten Hopp c9fe60
------------
Karsten Hopp c9fe60
Karsten Hopp c9fe60
Patch 7.4.519 (after 7.4.497)
Karsten Hopp c9fe60
Problem:    Crash when using syntax highlighting.
Karsten Hopp c9fe60
Solution:   When regprog is freed and replaced, store the result.
Karsten Hopp c9fe60
Files:	    src/buffer.c, src/regexp.c, src/syntax.c, src/spell.c,
Karsten Hopp c9fe60
	    src/ex_cmds2.c, src/fileio.c, src/proto/fileio.pro,
Karsten Hopp c9fe60
	    src/proto/regexp.pro, src/os_unix.c
Karsten Hopp c9fe60
Karsten Hopp c9fe60
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/buffer.c	2014-09-23 15:45:04.870801055 +0200
Karsten Hopp c9fe60
--- src/buffer.c	2014-11-19 15:50:34.129292586 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 28,36 ****
Karsten Hopp c9fe60
  #include "vim.h"
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
Karsten Hopp c9fe60
! static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf, int ignore_case));
Karsten Hopp c9fe60
  # define HAVE_BUFLIST_MATCH
Karsten Hopp c9fe60
! static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name, int ignore_case));
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
  static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
Karsten Hopp c9fe60
  static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
Karsten Hopp c9fe60
--- 28,36 ----
Karsten Hopp c9fe60
  #include "vim.h"
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
Karsten Hopp c9fe60
! static char_u	*buflist_match __ARGS((regmatch_T *rmp, buf_T *buf, int ignore_case));
Karsten Hopp c9fe60
  # define HAVE_BUFLIST_MATCH
Karsten Hopp c9fe60
! static char_u	*fname_match __ARGS((regmatch_T *rmp, char_u *name, int ignore_case));
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
  static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
Karsten Hopp c9fe60
  static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2220,2226 ****
Karsten Hopp c9fe60
      int		curtab_only;	/* find buffers in current tab only */
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      buf_T	*buf;
Karsten Hopp c9fe60
-     regprog_T	*prog;
Karsten Hopp c9fe60
      int		match = -1;
Karsten Hopp c9fe60
      int		find_listed;
Karsten Hopp c9fe60
      char_u	*pat;
Karsten Hopp c9fe60
--- 2220,2225 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2265,2278 ****
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    for (attempt = 0; attempt <= 3; ++attempt)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		/* may add '^' and '$' */
Karsten Hopp c9fe60
  		if (toggledollar)
Karsten Hopp c9fe60
  		    *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */
Karsten Hopp c9fe60
  		p = pat;
Karsten Hopp c9fe60
  		if (*p == '^' && !(attempt & 1))	 /* add/remove '^' */
Karsten Hopp c9fe60
  		    ++p;
Karsten Hopp c9fe60
! 		prog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
Karsten Hopp c9fe60
! 		if (prog == NULL)
Karsten Hopp c9fe60
  		{
Karsten Hopp c9fe60
  		    vim_free(pat);
Karsten Hopp c9fe60
  		    return -1;
Karsten Hopp c9fe60
--- 2264,2279 ----
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    for (attempt = 0; attempt <= 3; ++attempt)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
+ 		regmatch_T	regmatch;
Karsten Hopp c9fe60
+ 
Karsten Hopp c9fe60
  		/* may add '^' and '$' */
Karsten Hopp c9fe60
  		if (toggledollar)
Karsten Hopp c9fe60
  		    *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */
Karsten Hopp c9fe60
  		p = pat;
Karsten Hopp c9fe60
  		if (*p == '^' && !(attempt & 1))	 /* add/remove '^' */
Karsten Hopp c9fe60
  		    ++p;
Karsten Hopp c9fe60
! 		regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
Karsten Hopp c9fe60
! 		if (regmatch.regprog == NULL)
Karsten Hopp c9fe60
  		{
Karsten Hopp c9fe60
  		    vim_free(pat);
Karsten Hopp c9fe60
  		    return -1;
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2283,2289 ****
Karsten Hopp c9fe60
  #ifdef FEAT_DIFF
Karsten Hopp c9fe60
  			    && (!diffmode || diff_mode_buf(buf))
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
! 			    && buflist_match(prog, buf, FALSE) != NULL)
Karsten Hopp c9fe60
  		    {
Karsten Hopp c9fe60
  			if (curtab_only)
Karsten Hopp c9fe60
  			{
Karsten Hopp c9fe60
--- 2284,2290 ----
Karsten Hopp c9fe60
  #ifdef FEAT_DIFF
Karsten Hopp c9fe60
  			    && (!diffmode || diff_mode_buf(buf))
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
! 			    && buflist_match(&regmatch, buf, FALSE) != NULL)
Karsten Hopp c9fe60
  		    {
Karsten Hopp c9fe60
  			if (curtab_only)
Karsten Hopp c9fe60
  			{
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2310,2316 ****
Karsten Hopp c9fe60
  			match = buf->b_fnum;	/* remember first match */
Karsten Hopp c9fe60
  		    }
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
! 		vim_regfree(prog);
Karsten Hopp c9fe60
  		if (match >= 0)			/* found one match */
Karsten Hopp c9fe60
  		    break;
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
--- 2311,2317 ----
Karsten Hopp c9fe60
  			match = buf->b_fnum;	/* remember first match */
Karsten Hopp c9fe60
  		    }
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
! 		vim_regfree(regmatch.regprog);
Karsten Hopp c9fe60
  		if (match >= 0)			/* found one match */
Karsten Hopp c9fe60
  		    break;
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2352,2358 ****
Karsten Hopp c9fe60
      int		round;
Karsten Hopp c9fe60
      char_u	*p;
Karsten Hopp c9fe60
      int		attempt;
Karsten Hopp c9fe60
-     regprog_T	*prog;
Karsten Hopp c9fe60
      char_u	*patc;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      *num_file = 0;		    /* return values in case of FAIL */
Karsten Hopp c9fe60
--- 2353,2358 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2376,2385 ****
Karsten Hopp c9fe60
       */
Karsten Hopp c9fe60
      for (attempt = 0; attempt <= 1; ++attempt)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
  	if (attempt > 0 && patc == pat)
Karsten Hopp c9fe60
  	    break;	/* there was no anchor, no need to try again */
Karsten Hopp c9fe60
! 	prog = vim_regcomp(patc + attempt * 11, RE_MAGIC);
Karsten Hopp c9fe60
! 	if (prog == NULL)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    if (patc != pat)
Karsten Hopp c9fe60
  		vim_free(patc);
Karsten Hopp c9fe60
--- 2376,2387 ----
Karsten Hopp c9fe60
       */
Karsten Hopp c9fe60
      for (attempt = 0; attempt <= 1; ++attempt)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
+ 	regmatch_T	regmatch;
Karsten Hopp c9fe60
+ 
Karsten Hopp c9fe60
  	if (attempt > 0 && patc == pat)
Karsten Hopp c9fe60
  	    break;	/* there was no anchor, no need to try again */
Karsten Hopp c9fe60
! 	regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC);
Karsten Hopp c9fe60
! 	if (regmatch.regprog == NULL)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    if (patc != pat)
Karsten Hopp c9fe60
  		vim_free(patc);
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2397,2403 ****
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		if (!buf->b_p_bl)	/* skip unlisted buffers */
Karsten Hopp c9fe60
  		    continue;
Karsten Hopp c9fe60
! 		p = buflist_match(prog, buf, p_wic);
Karsten Hopp c9fe60
  		if (p != NULL)
Karsten Hopp c9fe60
  		{
Karsten Hopp c9fe60
  		    if (round == 1)
Karsten Hopp c9fe60
--- 2399,2405 ----
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		if (!buf->b_p_bl)	/* skip unlisted buffers */
Karsten Hopp c9fe60
  		    continue;
Karsten Hopp c9fe60
! 		p = buflist_match(&regmatch, buf, p_wic);
Karsten Hopp c9fe60
  		if (p != NULL)
Karsten Hopp c9fe60
  		{
Karsten Hopp c9fe60
  		    if (round == 1)
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2419,2432 ****
Karsten Hopp c9fe60
  		*file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
Karsten Hopp c9fe60
  		if (*file == NULL)
Karsten Hopp c9fe60
  		{
Karsten Hopp c9fe60
! 		    vim_regfree(prog);
Karsten Hopp c9fe60
  		    if (patc != pat)
Karsten Hopp c9fe60
  			vim_free(patc);
Karsten Hopp c9fe60
  		    return FAIL;
Karsten Hopp c9fe60
  		}
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
! 	vim_regfree(prog);
Karsten Hopp c9fe60
  	if (count)		/* match(es) found, break here */
Karsten Hopp c9fe60
  	    break;
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
--- 2421,2434 ----
Karsten Hopp c9fe60
  		*file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
Karsten Hopp c9fe60
  		if (*file == NULL)
Karsten Hopp c9fe60
  		{
Karsten Hopp c9fe60
! 		    vim_regfree(regmatch.regprog);
Karsten Hopp c9fe60
  		    if (patc != pat)
Karsten Hopp c9fe60
  			vim_free(patc);
Karsten Hopp c9fe60
  		    return FAIL;
Karsten Hopp c9fe60
  		}
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
! 	vim_regfree(regmatch.regprog);
Karsten Hopp c9fe60
  	if (count)		/* match(es) found, break here */
Karsten Hopp c9fe60
  	    break;
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2445,2461 ****
Karsten Hopp c9fe60
   * Check for a match on the file name for buffer "buf" with regprog "prog".
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
      static char_u *
Karsten Hopp c9fe60
! buflist_match(prog, buf, ignore_case)
Karsten Hopp c9fe60
!     regprog_T	*prog;
Karsten Hopp c9fe60
      buf_T	*buf;
Karsten Hopp c9fe60
      int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      char_u	*match;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      /* First try the short file name, then the long file name. */
Karsten Hopp c9fe60
!     match = fname_match(prog, buf->b_sfname, ignore_case);
Karsten Hopp c9fe60
      if (match == NULL)
Karsten Hopp c9fe60
! 	match = fname_match(prog, buf->b_ffname, ignore_case);
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      return match;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
--- 2447,2463 ----
Karsten Hopp c9fe60
   * Check for a match on the file name for buffer "buf" with regprog "prog".
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
      static char_u *
Karsten Hopp c9fe60
! buflist_match(rmp, buf, ignore_case)
Karsten Hopp c9fe60
!     regmatch_T	*rmp;
Karsten Hopp c9fe60
      buf_T	*buf;
Karsten Hopp c9fe60
      int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      char_u	*match;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      /* First try the short file name, then the long file name. */
Karsten Hopp c9fe60
!     match = fname_match(rmp, buf->b_sfname, ignore_case);
Karsten Hopp c9fe60
      if (match == NULL)
Karsten Hopp c9fe60
! 	match = fname_match(rmp, buf->b_ffname, ignore_case);
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      return match;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2465,2491 ****
Karsten Hopp c9fe60
   * Return "name" when there is a match, NULL when not.
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
      static char_u *
Karsten Hopp c9fe60
! fname_match(prog, name, ignore_case)
Karsten Hopp c9fe60
!     regprog_T	*prog;
Karsten Hopp c9fe60
      char_u	*name;
Karsten Hopp c9fe60
      int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      char_u	*match = NULL;
Karsten Hopp c9fe60
      char_u	*p;
Karsten Hopp c9fe60
-     regmatch_T	regmatch;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      if (name != NULL)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
- 	regmatch.regprog = prog;
Karsten Hopp c9fe60
  	/* Ignore case when 'fileignorecase' or the argument is set. */
Karsten Hopp c9fe60
! 	regmatch.rm_ic = p_fic || ignore_case;
Karsten Hopp c9fe60
! 	if (vim_regexec(&regmatch, name, (colnr_T)0))
Karsten Hopp c9fe60
  	    match = name;
Karsten Hopp c9fe60
  	else
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    /* Replace $(HOME) with '~' and try matching again. */
Karsten Hopp c9fe60
  	    p = home_replace_save(NULL, name);
Karsten Hopp c9fe60
! 	    if (p != NULL && vim_regexec(&regmatch, p, (colnr_T)0))
Karsten Hopp c9fe60
  		match = name;
Karsten Hopp c9fe60
  	    vim_free(p);
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
--- 2467,2491 ----
Karsten Hopp c9fe60
   * Return "name" when there is a match, NULL when not.
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
      static char_u *
Karsten Hopp c9fe60
! fname_match(rmp, name, ignore_case)
Karsten Hopp c9fe60
!     regmatch_T	*rmp;
Karsten Hopp c9fe60
      char_u	*name;
Karsten Hopp c9fe60
      int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      char_u	*match = NULL;
Karsten Hopp c9fe60
      char_u	*p;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      if (name != NULL)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
  	/* Ignore case when 'fileignorecase' or the argument is set. */
Karsten Hopp c9fe60
! 	rmp->rm_ic = p_fic || ignore_case;
Karsten Hopp c9fe60
! 	if (vim_regexec(rmp, name, (colnr_T)0))
Karsten Hopp c9fe60
  	    match = name;
Karsten Hopp c9fe60
  	else
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    /* Replace $(HOME) with '~' and try matching again. */
Karsten Hopp c9fe60
  	    p = home_replace_save(NULL, name);
Karsten Hopp c9fe60
! 	    if (p != NULL && vim_regexec(rmp, p, (colnr_T)0))
Karsten Hopp c9fe60
  		match = name;
Karsten Hopp c9fe60
  	    vim_free(p);
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/regexp.c	2014-11-05 14:26:30.760758363 +0100
Karsten Hopp c9fe60
--- src/regexp.c	2014-11-19 16:10:43.203390451 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 8163,8168 ****
Karsten Hopp c9fe60
--- 8163,8169 ----
Karsten Hopp c9fe60
  /*
Karsten Hopp c9fe60
   * Match a regexp against a string.
Karsten Hopp c9fe60
   * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
Karsten Hopp c9fe60
+  * Note: "rmp->regprog" may be freed and changed.
Karsten Hopp c9fe60
   * Uses curbuf for line count and 'iskeyword'.
Karsten Hopp c9fe60
   * When "nl" is TRUE consider a "\n" in "line" to be a line break.
Karsten Hopp c9fe60
   *
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 8203,8208 ****
Karsten Hopp c9fe60
--- 8204,8232 ----
Karsten Hopp c9fe60
      return result;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
+ /*
Karsten Hopp c9fe60
+  * Note: "*prog" may be freed and changed.
Karsten Hopp c9fe60
+  */
Karsten Hopp c9fe60
+     int
Karsten Hopp c9fe60
+ vim_regexec_prog(prog, ignore_case, line, col)
Karsten Hopp c9fe60
+     regprog_T	**prog;
Karsten Hopp c9fe60
+     int		ignore_case;
Karsten Hopp c9fe60
+     char_u	*line;
Karsten Hopp c9fe60
+     colnr_T	col;
Karsten Hopp c9fe60
+ {
Karsten Hopp c9fe60
+     int r;
Karsten Hopp c9fe60
+     regmatch_T regmatch;
Karsten Hopp c9fe60
+ 
Karsten Hopp c9fe60
+     regmatch.regprog = *prog;
Karsten Hopp c9fe60
+     regmatch.rm_ic = ignore_case;
Karsten Hopp c9fe60
+     r = vim_regexec_both(&regmatch, line, col, FALSE);
Karsten Hopp c9fe60
+     *prog = regmatch.regprog;
Karsten Hopp c9fe60
+     return r;
Karsten Hopp c9fe60
+ }
Karsten Hopp c9fe60
+ 
Karsten Hopp c9fe60
+ /*
Karsten Hopp c9fe60
+  * Note: "rmp->regprog" may be freed and changed.
Karsten Hopp c9fe60
+  */
Karsten Hopp c9fe60
      int
Karsten Hopp c9fe60
  vim_regexec(rmp, line, col)
Karsten Hopp c9fe60
      regmatch_T	*rmp;
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 8216,8221 ****
Karsten Hopp c9fe60
--- 8240,8246 ----
Karsten Hopp c9fe60
  	|| defined(FIND_REPLACE_DIALOG) || defined(PROTO)
Karsten Hopp c9fe60
  /*
Karsten Hopp c9fe60
   * Like vim_regexec(), but consider a "\n" in "line" to be a line break.
Karsten Hopp c9fe60
+  * Note: "rmp->regprog" may be freed and changed.
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
      int
Karsten Hopp c9fe60
  vim_regexec_nl(rmp, line, col)
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 8230,8235 ****
Karsten Hopp c9fe60
--- 8255,8261 ----
Karsten Hopp c9fe60
  /*
Karsten Hopp c9fe60
   * Match a regexp against multiple lines.
Karsten Hopp c9fe60
   * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
Karsten Hopp c9fe60
+  * Note: "rmp->regprog" may be freed and changed.
Karsten Hopp c9fe60
   * Uses curbuf for line count and 'iskeyword'.
Karsten Hopp c9fe60
   *
Karsten Hopp c9fe60
   * Return zero if there is no match.  Return number of lines contained in the
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/syntax.c	2014-06-12 12:20:50.191541385 +0200
Karsten Hopp c9fe60
--- src/syntax.c	2014-11-19 15:39:08.493182536 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 992,1004 ****
Karsten Hopp c9fe60
      linenr_T	lnum;
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      regmmatch_T regmatch;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      if (syn_block->b_syn_linecont_prog != NULL)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
  	regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
Karsten Hopp c9fe60
  	regmatch.regprog = syn_block->b_syn_linecont_prog;
Karsten Hopp c9fe60
! 	return syn_regexec(&regmatch, lnum, (colnr_T)0,
Karsten Hopp c9fe60
  				IF_SYN_TIME(&syn_block->b_syn_linecont_time));
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
      return FALSE;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
--- 992,1007 ----
Karsten Hopp c9fe60
      linenr_T	lnum;
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      regmmatch_T regmatch;
Karsten Hopp c9fe60
+     int r;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      if (syn_block->b_syn_linecont_prog != NULL)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
  	regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
Karsten Hopp c9fe60
  	regmatch.regprog = syn_block->b_syn_linecont_prog;
Karsten Hopp c9fe60
! 	r = syn_regexec(&regmatch, lnum, (colnr_T)0,
Karsten Hopp c9fe60
  				IF_SYN_TIME(&syn_block->b_syn_linecont_time));
Karsten Hopp c9fe60
+ 	syn_block->b_syn_linecont_prog = regmatch.regprog;
Karsten Hopp c9fe60
+ 	return r;
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
      return FALSE;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2075,2080 ****
Karsten Hopp c9fe60
--- 2078,2085 ----
Karsten Hopp c9fe60
  					    cur_si->si_cont_list, &spp->sp_syn,
Karsten Hopp c9fe60
  					    spp->sp_flags & HL_CONTAINED))))
Karsten Hopp c9fe60
  			{
Karsten Hopp c9fe60
+ 			    int r;
Karsten Hopp c9fe60
+ 
Karsten Hopp c9fe60
  			    /* If we already tried matching in this line, and
Karsten Hopp c9fe60
  			     * there isn't a match before next_match_col, skip
Karsten Hopp c9fe60
  			     * this item. */
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2089,2098 ****
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  			    regmatch.rmm_ic = spp->sp_ic;
Karsten Hopp c9fe60
  			    regmatch.regprog = spp->sp_prog;
Karsten Hopp c9fe60
! 			    if (!syn_regexec(&regmatch,
Karsten Hopp c9fe60
  					     current_lnum,
Karsten Hopp c9fe60
  					     (colnr_T)lc_col,
Karsten Hopp c9fe60
! 				             IF_SYN_TIME(&spp->sp_time)))
Karsten Hopp c9fe60
  			    {
Karsten Hopp c9fe60
  				/* no match in this line, try another one */
Karsten Hopp c9fe60
  				spp->sp_startcol = MAXCOL;
Karsten Hopp c9fe60
--- 2094,2105 ----
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  			    regmatch.rmm_ic = spp->sp_ic;
Karsten Hopp c9fe60
  			    regmatch.regprog = spp->sp_prog;
Karsten Hopp c9fe60
! 			    r = syn_regexec(&regmatch,
Karsten Hopp c9fe60
  					     current_lnum,
Karsten Hopp c9fe60
  					     (colnr_T)lc_col,
Karsten Hopp c9fe60
! 				             IF_SYN_TIME(&spp->sp_time));
Karsten Hopp c9fe60
! 			    spp->sp_prog = regmatch.regprog;
Karsten Hopp c9fe60
! 			    if (!r)
Karsten Hopp c9fe60
  			    {
Karsten Hopp c9fe60
  				/* no match in this line, try another one */
Karsten Hopp c9fe60
  				spp->sp_startcol = MAXCOL;
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2963,2968 ****
Karsten Hopp c9fe60
--- 2970,2976 ----
Karsten Hopp c9fe60
  	for (idx = start_idx; idx < syn_block->b_syn_patterns.ga_len; ++idx)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    int lc_col = matchcol;
Karsten Hopp c9fe60
+ 	    int r;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	    spp = &(SYN_ITEMS(syn_block)[idx]);
Karsten Hopp c9fe60
  	    if (spp->sp_type != SPTYPE_END)	/* past last END pattern */
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 2973,2980 ****
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	    regmatch.rmm_ic = spp->sp_ic;
Karsten Hopp c9fe60
  	    regmatch.regprog = spp->sp_prog;
Karsten Hopp c9fe60
! 	    if (syn_regexec(&regmatch, startpos->lnum, lc_col,
Karsten Hopp c9fe60
! 						  IF_SYN_TIME(&spp->sp_time)))
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		if (best_idx == -1 || regmatch.startpos[0].col
Karsten Hopp c9fe60
  					      < best_regmatch.startpos[0].col)
Karsten Hopp c9fe60
--- 2981,2990 ----
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	    regmatch.rmm_ic = spp->sp_ic;
Karsten Hopp c9fe60
  	    regmatch.regprog = spp->sp_prog;
Karsten Hopp c9fe60
! 	    r = syn_regexec(&regmatch, startpos->lnum, lc_col,
Karsten Hopp c9fe60
! 						  IF_SYN_TIME(&spp->sp_time));
Karsten Hopp c9fe60
! 	    spp->sp_prog = regmatch.regprog;
Karsten Hopp c9fe60
! 	    if (r)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		if (best_idx == -1 || regmatch.startpos[0].col
Karsten Hopp c9fe60
  					      < best_regmatch.startpos[0].col)
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 3000,3013 ****
Karsten Hopp c9fe60
  	if (spp_skip != NULL)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    int lc_col = matchcol - spp_skip->sp_offsets[SPO_LC_OFF];
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	    if (lc_col < 0)
Karsten Hopp c9fe60
  		lc_col = 0;
Karsten Hopp c9fe60
  	    regmatch.rmm_ic = spp_skip->sp_ic;
Karsten Hopp c9fe60
  	    regmatch.regprog = spp_skip->sp_prog;
Karsten Hopp c9fe60
! 	    if (syn_regexec(&regmatch, startpos->lnum, lc_col,
Karsten Hopp c9fe60
! 					      IF_SYN_TIME(&spp_skip->sp_time))
Karsten Hopp c9fe60
! 		    && regmatch.startpos[0].col
Karsten Hopp c9fe60
  					     <= best_regmatch.startpos[0].col)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		/* Add offset to skip pattern match */
Karsten Hopp c9fe60
--- 3010,3025 ----
Karsten Hopp c9fe60
  	if (spp_skip != NULL)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    int lc_col = matchcol - spp_skip->sp_offsets[SPO_LC_OFF];
Karsten Hopp c9fe60
+ 	    int r;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	    if (lc_col < 0)
Karsten Hopp c9fe60
  		lc_col = 0;
Karsten Hopp c9fe60
  	    regmatch.rmm_ic = spp_skip->sp_ic;
Karsten Hopp c9fe60
  	    regmatch.regprog = spp_skip->sp_prog;
Karsten Hopp c9fe60
! 	    r = syn_regexec(&regmatch, startpos->lnum, lc_col,
Karsten Hopp c9fe60
! 					      IF_SYN_TIME(&spp_skip->sp_time));
Karsten Hopp c9fe60
! 	    spp_skip->sp_prog = regmatch.regprog;
Karsten Hopp c9fe60
! 	    if (r && regmatch.startpos[0].col
Karsten Hopp c9fe60
  					     <= best_regmatch.startpos[0].col)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		/* Add offset to skip pattern match */
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/spell.c	2014-09-19 16:04:08.050417797 +0200
Karsten Hopp c9fe60
--- src/spell.c	2014-11-19 16:28:49.798964748 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1154,1164 ****
Karsten Hopp c9fe60
  	    if (capcol != NULL && wp->w_s->b_cap_prog != NULL)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		regmatch_T	regmatch;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  		/* Check for end of sentence. */
Karsten Hopp c9fe60
  		regmatch.regprog = wp->w_s->b_cap_prog;
Karsten Hopp c9fe60
  		regmatch.rm_ic = FALSE;
Karsten Hopp c9fe60
! 		if (vim_regexec(&regmatch, ptr, 0))
Karsten Hopp c9fe60
  		    *capcol = (int)(regmatch.endp[0] - ptr);
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
--- 1154,1167 ----
Karsten Hopp c9fe60
  	    if (capcol != NULL && wp->w_s->b_cap_prog != NULL)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		regmatch_T	regmatch;
Karsten Hopp c9fe60
+ 		int		r;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  		/* Check for end of sentence. */
Karsten Hopp c9fe60
  		regmatch.regprog = wp->w_s->b_cap_prog;
Karsten Hopp c9fe60
  		regmatch.rm_ic = FALSE;
Karsten Hopp c9fe60
! 		r = vim_regexec(&regmatch, ptr, 0);
Karsten Hopp c9fe60
! 		wp->w_s->b_cap_prog = regmatch.regprog;
Karsten Hopp c9fe60
! 		if (r)
Karsten Hopp c9fe60
  		    *capcol = (int)(regmatch.endp[0] - ptr);
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1786,1792 ****
Karsten Hopp c9fe60
      char_u	*word;
Karsten Hopp c9fe60
      char_u	*flags;
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
-     regmatch_T	regmatch;
Karsten Hopp c9fe60
  #ifdef FEAT_MBYTE
Karsten Hopp c9fe60
      char_u	uflags[MAXWLEN * 2];
Karsten Hopp c9fe60
      int		i;
Karsten Hopp c9fe60
--- 1789,1794 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1808,1816 ****
Karsten Hopp c9fe60
      else
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
  	p = flags;
Karsten Hopp c9fe60
!     regmatch.regprog = slang->sl_compprog;
Karsten Hopp c9fe60
!     regmatch.rm_ic = FALSE;
Karsten Hopp c9fe60
!     if (!vim_regexec(&regmatch, p, 0))
Karsten Hopp c9fe60
  	return FALSE;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      /* Count the number of syllables.  This may be slow, do it last.  If there
Karsten Hopp c9fe60
--- 1810,1816 ----
Karsten Hopp c9fe60
      else
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
  	p = flags;
Karsten Hopp c9fe60
!     if (!vim_regexec_prog(&slang->sl_compprog, FALSE, p, 0))
Karsten Hopp c9fe60
  	return FALSE;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      /* Count the number of syllables.  This may be slow, do it last.  If there
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1930,1937 ****
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      int		prefcnt;
Karsten Hopp c9fe60
      int		pidx;
Karsten Hopp c9fe60
!     regprog_T	*rp;
Karsten Hopp c9fe60
!     regmatch_T	regmatch;
Karsten Hopp c9fe60
      int		prefid;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      prefid = (unsigned)flags >> 24;
Karsten Hopp c9fe60
--- 1930,1936 ----
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
      int		prefcnt;
Karsten Hopp c9fe60
      int		pidx;
Karsten Hopp c9fe60
!     regprog_T	**rp;
Karsten Hopp c9fe60
      int		prefid;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      prefid = (unsigned)flags >> 24;
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1950,1961 ****
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	/* Check the condition, if there is one.  The condition index is
Karsten Hopp c9fe60
  	 * stored in the two bytes above the prefix ID byte.  */
Karsten Hopp c9fe60
! 	rp = slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff];
Karsten Hopp c9fe60
! 	if (rp != NULL)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
! 	    regmatch.regprog = rp;
Karsten Hopp c9fe60
! 	    regmatch.rm_ic = FALSE;
Karsten Hopp c9fe60
! 	    if (!vim_regexec(&regmatch, word, 0))
Karsten Hopp c9fe60
  		continue;
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
  	else if (cond_req)
Karsten Hopp c9fe60
--- 1949,1958 ----
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  	/* Check the condition, if there is one.  The condition index is
Karsten Hopp c9fe60
  	 * stored in the two bytes above the prefix ID byte.  */
Karsten Hopp c9fe60
! 	rp = &slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff];
Karsten Hopp c9fe60
! 	if (*rp != NULL)
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
! 	    if (!vim_regexec_prog(rp, FALSE, word, 0))
Karsten Hopp c9fe60
  		continue;
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
  	else if (cond_req)
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 6903,6909 ****
Karsten Hopp c9fe60
      hashitem_T	*hi;
Karsten Hopp c9fe60
      affheader_T	*ah;
Karsten Hopp c9fe60
      affentry_T	*ae;
Karsten Hopp c9fe60
-     regmatch_T	regmatch;
Karsten Hopp c9fe60
      char_u	newword[MAXWLEN];
Karsten Hopp c9fe60
      int		retval = OK;
Karsten Hopp c9fe60
      int		i, j;
Karsten Hopp c9fe60
--- 6900,6905 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 6944,6958 ****
Karsten Hopp c9fe60
  		     * When a previously added affix had CIRCUMFIX this one
Karsten Hopp c9fe60
  		     * must have it too, if it had not then this one must not
Karsten Hopp c9fe60
  		     * have one either. */
Karsten Hopp c9fe60
- 		    regmatch.regprog = ae->ae_prog;
Karsten Hopp c9fe60
- 		    regmatch.rm_ic = FALSE;
Karsten Hopp c9fe60
  		    if ((xht != NULL || !affile->af_pfxpostpone
Karsten Hopp c9fe60
  				|| ae->ae_chop != NULL
Karsten Hopp c9fe60
  				|| ae->ae_flags != NULL)
Karsten Hopp c9fe60
  			    && (ae->ae_chop == NULL
Karsten Hopp c9fe60
  				|| STRLEN(ae->ae_chop) < wordlen)
Karsten Hopp c9fe60
  			    && (ae->ae_prog == NULL
Karsten Hopp c9fe60
! 				|| vim_regexec(&regmatch, word, (colnr_T)0))
Karsten Hopp c9fe60
  			    && (((condit & CONDIT_CFIX) == 0)
Karsten Hopp c9fe60
  				== ((condit & CONDIT_AFF) == 0
Karsten Hopp c9fe60
  				    || ae->ae_flags == NULL
Karsten Hopp c9fe60
--- 6940,6953 ----
Karsten Hopp c9fe60
  		     * When a previously added affix had CIRCUMFIX this one
Karsten Hopp c9fe60
  		     * must have it too, if it had not then this one must not
Karsten Hopp c9fe60
  		     * have one either. */
Karsten Hopp c9fe60
  		    if ((xht != NULL || !affile->af_pfxpostpone
Karsten Hopp c9fe60
  				|| ae->ae_chop != NULL
Karsten Hopp c9fe60
  				|| ae->ae_flags != NULL)
Karsten Hopp c9fe60
  			    && (ae->ae_chop == NULL
Karsten Hopp c9fe60
  				|| STRLEN(ae->ae_chop) < wordlen)
Karsten Hopp c9fe60
  			    && (ae->ae_prog == NULL
Karsten Hopp c9fe60
! 				|| vim_regexec_prog(&ae->ae_prog, FALSE,
Karsten Hopp c9fe60
! 							    word, (colnr_T)0))
Karsten Hopp c9fe60
  			    && (((condit & CONDIT_CFIX) == 0)
Karsten Hopp c9fe60
  				== ((condit & CONDIT_AFF) == 0
Karsten Hopp c9fe60
  				    || ae->ae_flags == NULL
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 10478,10483 ****
Karsten Hopp c9fe60
--- 10473,10479 ----
Karsten Hopp c9fe60
  		break;
Karsten Hopp c9fe60
  	    }
Karsten Hopp c9fe60
  	}
Karsten Hopp c9fe60
+ 	curwin->w_s->b_cap_prog = regmatch.regprog;
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
      vim_free(line_copy);
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/ex_cmds2.c	2014-08-06 18:17:03.471147780 +0200
Karsten Hopp c9fe60
--- src/ex_cmds2.c	2014-11-19 16:24:22.162013396 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 739,745 ****
Karsten Hopp c9fe60
      struct debuggy *bp;
Karsten Hopp c9fe60
      int		i;
Karsten Hopp c9fe60
      linenr_T	lnum = 0;
Karsten Hopp c9fe60
-     regmatch_T	regmatch;
Karsten Hopp c9fe60
      char_u	*name = fname;
Karsten Hopp c9fe60
      int		prev_got_int;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
--- 739,744 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 771,778 ****
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
  		(bp->dbg_lnum > after && (lnum == 0 || bp->dbg_lnum < lnum)))))
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
- 	    regmatch.regprog = bp->dbg_prog;
Karsten Hopp c9fe60
- 	    regmatch.rm_ic = FALSE;
Karsten Hopp c9fe60
  	    /*
Karsten Hopp c9fe60
  	     * Save the value of got_int and reset it.  We don't want a
Karsten Hopp c9fe60
  	     * previous interruption cancel matching, only hitting CTRL-C
Karsten Hopp c9fe60
--- 770,775 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 780,786 ****
Karsten Hopp c9fe60
  	     */
Karsten Hopp c9fe60
  	    prev_got_int = got_int;
Karsten Hopp c9fe60
  	    got_int = FALSE;
Karsten Hopp c9fe60
! 	    if (vim_regexec(&regmatch, name, (colnr_T)0))
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		lnum = bp->dbg_lnum;
Karsten Hopp c9fe60
  		if (fp != NULL)
Karsten Hopp c9fe60
--- 777,783 ----
Karsten Hopp c9fe60
  	     */
Karsten Hopp c9fe60
  	    prev_got_int = got_int;
Karsten Hopp c9fe60
  	    got_int = FALSE;
Karsten Hopp c9fe60
! 	    if (vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0))
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
  		lnum = bp->dbg_lnum;
Karsten Hopp c9fe60
  		if (fp != NULL)
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/fileio.c	2014-11-12 15:15:34.983882077 +0100
Karsten Hopp c9fe60
--- src/fileio.c	2014-11-19 15:57:01.496837984 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 7772,7777 ****
Karsten Hopp c9fe60
--- 7772,7780 ----
Karsten Hopp c9fe60
  static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
Karsten Hopp c9fe60
  static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
Karsten Hopp c9fe60
  static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
Karsten Hopp c9fe60
+ #if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN)
Karsten Hopp c9fe60
+ static int match_file_pat __ARGS((char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
Karsten Hopp c9fe60
+ #endif
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
  static event_T	last_event;
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 9640,9646 ****
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    /* execution-condition */
Karsten Hopp c9fe60
  	    if (ap->buflocal_nr == 0
Karsten Hopp c9fe60
! 		    ? (match_file_pat(NULL, ap->reg_prog, apc->fname,
Karsten Hopp c9fe60
  				      apc->sfname, apc->tail, ap->allow_dirs))
Karsten Hopp c9fe60
  		    : ap->buflocal_nr == apc->arg_bufnr)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
--- 9643,9649 ----
Karsten Hopp c9fe60
  	{
Karsten Hopp c9fe60
  	    /* execution-condition */
Karsten Hopp c9fe60
  	    if (ap->buflocal_nr == 0
Karsten Hopp c9fe60
! 		    ? (match_file_pat(NULL, &ap->reg_prog, apc->fname,
Karsten Hopp c9fe60
  				      apc->sfname, apc->tail, ap->allow_dirs))
Karsten Hopp c9fe60
  		    : ap->buflocal_nr == apc->arg_bufnr)
Karsten Hopp c9fe60
  	    {
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 9774,9780 ****
Karsten Hopp c9fe60
      for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
Karsten Hopp c9fe60
  	if (ap->pat != NULL && ap->cmds != NULL
Karsten Hopp c9fe60
  	      && (ap->buflocal_nr == 0
Karsten Hopp c9fe60
! 		? match_file_pat(NULL, ap->reg_prog,
Karsten Hopp c9fe60
  					  fname, sfname, tail, ap->allow_dirs)
Karsten Hopp c9fe60
  		: buf != NULL && ap->buflocal_nr == buf->b_fnum
Karsten Hopp c9fe60
  	   ))
Karsten Hopp c9fe60
--- 9777,9783 ----
Karsten Hopp c9fe60
      for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
Karsten Hopp c9fe60
  	if (ap->pat != NULL && ap->cmds != NULL
Karsten Hopp c9fe60
  	      && (ap->buflocal_nr == 0
Karsten Hopp c9fe60
! 		? match_file_pat(NULL, &ap->reg_prog,
Karsten Hopp c9fe60
  					  fname, sfname, tail, ap->allow_dirs)
Karsten Hopp c9fe60
  		: buf != NULL && ap->buflocal_nr == buf->b_fnum
Karsten Hopp c9fe60
  	   ))
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 10035,10044 ****
Karsten Hopp c9fe60
   * Used for autocommands and 'wildignore'.
Karsten Hopp c9fe60
   * Returns TRUE if there is a match, FALSE otherwise.
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
!     int
Karsten Hopp c9fe60
  match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
Karsten Hopp c9fe60
      char_u	*pattern;		/* pattern to match with */
Karsten Hopp c9fe60
!     regprog_T	*prog;			/* pre-compiled regprog or NULL */
Karsten Hopp c9fe60
      char_u	*fname;			/* full path of file name */
Karsten Hopp c9fe60
      char_u	*sfname;		/* short file name or NULL */
Karsten Hopp c9fe60
      char_u	*tail;			/* tail of path */
Karsten Hopp c9fe60
--- 10038,10047 ----
Karsten Hopp c9fe60
   * Used for autocommands and 'wildignore'.
Karsten Hopp c9fe60
   * Returns TRUE if there is a match, FALSE otherwise.
Karsten Hopp c9fe60
   */
Karsten Hopp c9fe60
!     static int
Karsten Hopp c9fe60
  match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
Karsten Hopp c9fe60
      char_u	*pattern;		/* pattern to match with */
Karsten Hopp c9fe60
!     regprog_T	**prog;			/* pre-compiled regprog or NULL */
Karsten Hopp c9fe60
      char_u	*fname;			/* full path of file name */
Karsten Hopp c9fe60
      char_u	*sfname;		/* short file name or NULL */
Karsten Hopp c9fe60
      char_u	*tail;			/* tail of path */
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 10093,10099 ****
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
  	if (prog != NULL)
Karsten Hopp c9fe60
! 	    regmatch.regprog = prog;
Karsten Hopp c9fe60
  	else
Karsten Hopp c9fe60
  	    regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
--- 10096,10102 ----
Karsten Hopp c9fe60
  #endif
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
  	if (prog != NULL)
Karsten Hopp c9fe60
! 	    regmatch.regprog = *prog;
Karsten Hopp c9fe60
  	else
Karsten Hopp c9fe60
  	    regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 10119,10125 ****
Karsten Hopp c9fe60
  		 || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0)))))
Karsten Hopp c9fe60
  	result = TRUE;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
!     if (prog == NULL)
Karsten Hopp c9fe60
  	vim_regfree(regmatch.regprog);
Karsten Hopp c9fe60
      return result;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
--- 10122,10130 ----
Karsten Hopp c9fe60
  		 || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0)))))
Karsten Hopp c9fe60
  	result = TRUE;
Karsten Hopp c9fe60
  
Karsten Hopp c9fe60
!     if (prog != NULL)
Karsten Hopp c9fe60
! 	*prog = regmatch.regprog;
Karsten Hopp c9fe60
!     else
Karsten Hopp c9fe60
  	vim_regfree(regmatch.regprog);
Karsten Hopp c9fe60
      return result;
Karsten Hopp c9fe60
  }
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/proto/fileio.pro	2014-08-22 23:05:50.106606614 +0200
Karsten Hopp c9fe60
--- src/proto/fileio.pro	2014-11-19 15:55:55.013602515 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 59,65 ****
Karsten Hopp c9fe60
  char_u *get_event_name __ARGS((expand_T *xp, int idx));
Karsten Hopp c9fe60
  int autocmd_supported __ARGS((char_u *name));
Karsten Hopp c9fe60
  int au_exists __ARGS((char_u *arg));
Karsten Hopp c9fe60
- int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
Karsten Hopp c9fe60
  int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname));
Karsten Hopp c9fe60
  char_u *file_pat_to_reg_pat __ARGS((char_u *pat, char_u *pat_end, char *allow_dirs, int no_bslash));
Karsten Hopp c9fe60
  long read_eintr __ARGS((int fd, void *buf, size_t bufsize));
Karsten Hopp c9fe60
--- 59,64 ----
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/proto/regexp.pro	2014-04-02 19:00:53.043644100 +0200
Karsten Hopp c9fe60
--- src/proto/regexp.pro	2014-11-19 16:11:34.522800480 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 13,18 ****
Karsten Hopp c9fe60
--- 13,19 ----
Karsten Hopp c9fe60
  list_T *reg_submatch_list __ARGS((int no));
Karsten Hopp c9fe60
  regprog_T *vim_regcomp __ARGS((char_u *expr_arg, int re_flags));
Karsten Hopp c9fe60
  void vim_regfree __ARGS((regprog_T *prog));
Karsten Hopp c9fe60
+ int vim_regexec_prog __ARGS((regprog_T **prog, int ignore_case, char_u *line, colnr_T col));
Karsten Hopp c9fe60
  int vim_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
Karsten Hopp c9fe60
  int vim_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
Karsten Hopp c9fe60
  long vim_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm));
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/os_unix.c	2014-10-11 14:47:22.829275547 +0200
Karsten Hopp c9fe60
--- src/os_unix.c	2014-11-19 16:26:48.504346537 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1610,1617 ****
Karsten Hopp c9fe60
      static int
Karsten Hopp c9fe60
  x_connect_to_server()
Karsten Hopp c9fe60
  {
Karsten Hopp c9fe60
-     regmatch_T	regmatch;
Karsten Hopp c9fe60
- 
Karsten Hopp c9fe60
  #if defined(FEAT_CLIENTSERVER)
Karsten Hopp c9fe60
      if (x_force_connect)
Karsten Hopp c9fe60
  	return TRUE;
Karsten Hopp c9fe60
--- 1610,1615 ----
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 1622,1630 ****
Karsten Hopp c9fe60
      /* Check for a match with "exclude:" from 'clipboard'. */
Karsten Hopp c9fe60
      if (clip_exclude_prog != NULL)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
! 	regmatch.rm_ic = FALSE;		/* Don't ignore case */
Karsten Hopp c9fe60
! 	regmatch.regprog = clip_exclude_prog;
Karsten Hopp c9fe60
! 	if (vim_regexec(&regmatch, T_NAME, (colnr_T)0))
Karsten Hopp c9fe60
  	    return FALSE;
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
      return TRUE;
Karsten Hopp c9fe60
--- 1620,1626 ----
Karsten Hopp c9fe60
      /* Check for a match with "exclude:" from 'clipboard'. */
Karsten Hopp c9fe60
      if (clip_exclude_prog != NULL)
Karsten Hopp c9fe60
      {
Karsten Hopp c9fe60
! 	if (vim_regexec_prog(&clip_exclude_prog, FALSE, T_NAME, (colnr_T)0))
Karsten Hopp c9fe60
  	    return FALSE;
Karsten Hopp c9fe60
      }
Karsten Hopp c9fe60
      return TRUE;
Karsten Hopp c9fe60
*** ../vim-7.4.518/src/version.c	2014-11-19 13:40:04.903715962 +0100
Karsten Hopp c9fe60
--- src/version.c	2014-11-19 15:22:36.464620036 +0100
Karsten Hopp c9fe60
***************
Karsten Hopp c9fe60
*** 743,744 ****
Karsten Hopp c9fe60
--- 743,746 ----
Karsten Hopp c9fe60
  {   /* Add new patch number below this line */
Karsten Hopp c9fe60
+ /**/
Karsten Hopp c9fe60
+     519,
Karsten Hopp c9fe60
  /**/
Karsten Hopp c9fe60
Karsten Hopp c9fe60
-- 
Karsten Hopp c9fe60
BRIDGEKEEPER: What is your favorite editor?
Karsten Hopp c9fe60
GAWAIN:       Emacs ...  No, Viiiiiiiiiiimmmmmmm!
Karsten Hopp c9fe60
           "Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD
Karsten Hopp c9fe60
Karsten Hopp c9fe60
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp c9fe60
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp c9fe60
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp c9fe60
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///