Blob Blame History Raw
To: vim_dev@googlegroups.com
Subject: Patch 7.3.399
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.399
Problem:    ":cd" doesn't work when the path contains wildcards. (Yukihiro
	    Nakadaira)
Solution:   Ignore wildcard errors when the EW_NOTWILD flag is used.
Files:	    src/misc1.c


*** ../vim-7.3.398/src/misc1.c	2011-12-14 20:21:29.000000000 +0100
--- src/misc1.c	2012-01-10 17:57:42.000000000 +0100
***************
*** 9103,9117 ****
      }
  
      /* compile the regexp into a program */
!     if (flags & EW_NOERROR)
  	++emsg_silent;
      regmatch.rm_ic = TRUE;		/* Always ignore case */
      regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
!     if (flags & EW_NOERROR)
  	--emsg_silent;
      vim_free(pat);
  
!     if (regmatch.regprog == NULL)
      {
  	vim_free(buf);
  	return 0;
--- 9103,9117 ----
      }
  
      /* compile the regexp into a program */
!     if (flags & (EW_NOERROR | EW_NOTWILD))
  	++emsg_silent;
      regmatch.rm_ic = TRUE;		/* Always ignore case */
      regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
!     if (flags & (EW_NOERROR | EW_NOTWILD))
  	--emsg_silent;
      vim_free(pat);
  
!     if (regmatch.regprog == NULL && (flags & EW_NOTWILD) == 0)
      {
  	vim_free(buf);
  	return 0;
***************
*** 9179,9185 ****
  	 * all entries found with "matchname". */
  	if ((p[0] != '.' || starts_with_dot)
  		&& (matchname == NULL
! 		  || vim_regexec(&regmatch, p, (colnr_T)0)
  		  || ((flags & EW_NOTWILD)
  		     && fnamencmp(path + (s - buf), p, e - s) == 0)))
  	{
--- 9179,9186 ----
  	 * all entries found with "matchname". */
  	if ((p[0] != '.' || starts_with_dot)
  		&& (matchname == NULL
! 		  || (regmatch.regprog != NULL
! 				     && vim_regexec(&regmatch, p, (colnr_T)0))
  		  || ((flags & EW_NOTWILD)
  		     && fnamencmp(path + (s - buf), p, e - s) == 0)))
  	{
***************
*** 9419,9428 ****
      else
  	regmatch.rm_ic = FALSE;		/* Don't ignore case */
  #endif
      regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
      vim_free(pat);
  
!     if (regmatch.regprog == NULL)
      {
  	vim_free(buf);
  	return 0;
--- 9420,9433 ----
      else
  	regmatch.rm_ic = FALSE;		/* Don't ignore case */
  #endif
+     if (flags & (EW_NOERROR | EW_NOTWILD))
+ 	++emsg_silent;
      regmatch.regprog = vim_regcomp(pat, RE_MAGIC);
+     if (flags & (EW_NOERROR | EW_NOTWILD))
+ 	--emsg_silent;
      vim_free(pat);
  
!     if (regmatch.regprog == NULL && (flags & EW_NOTWILD) == 0)
      {
  	vim_free(buf);
  	return 0;
***************
*** 9452,9458 ****
  	    if (dp == NULL)
  		break;
  	    if ((dp->d_name[0] != '.' || starts_with_dot)
! 		 && (vim_regexec(&regmatch, (char_u *)dp->d_name, (colnr_T)0)
  		   || ((flags & EW_NOTWILD)
  		     && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0)))
  	    {
--- 9457,9464 ----
  	    if (dp == NULL)
  		break;
  	    if ((dp->d_name[0] != '.' || starts_with_dot)
! 		 && ((regmatch.regprog != NULL && vim_regexec(&regmatch,
! 					     (char_u *)dp->d_name, (colnr_T)0))
  		   || ((flags & EW_NOTWILD)
  		     && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0)))
  	    {
*** ../vim-7.3.398/src/version.c	2012-01-10 17:13:48.000000000 +0100
--- src/version.c	2012-01-10 18:21:05.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     399,
  /**/

-- 
Close your shells, or I'll kill -9 you
Tomorrow I'll quota you
Remember the disks'll always be full
And then while I'm away
I'll write ~ everyday
And I'll send-pr all my buggings to you.
    [ CVS log "Beatles style" for FreeBSD ports/INDEX, Satoshi Asami ]

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///