f0b6d33
To: vim-dev@vim.org
f0b6d33
Subject: Patch 7.2.234
f0b6d33
Fcc: outbox
f0b6d33
From: Bram Moolenaar <Bram@moolenaar.net>
f0b6d33
Mime-Version: 1.0
f0b6d33
Content-Type: text/plain; charset=UTF-8
f0b6d33
Content-Transfer-Encoding: 8bit
f0b6d33
------------
f0b6d33
f0b6d33
Patch 7.2.234
f0b6d33
Problem:    It is not possible to ignore file names without a suffix.
f0b6d33
Solution:   Use an empty entry in 'suffixes' for file names without a dot.
f0b6d33
Files:	    runtime/doc/cmdline.txt, src/misc1.c
f0b6d33
f0b6d33
f0b6d33
*** ../vim-7.2.233/runtime/doc/cmdline.txt	2008-11-09 13:43:25.000000000 +0100
f0b6d33
--- runtime/doc/cmdline.txt	2009-07-14 13:35:56.000000000 +0200
f0b6d33
***************
f0b6d33
*** 441,453 ****
f0b6d33
  those files with an extension that is in the 'suffixes' option are ignored.
f0b6d33
  The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
f0b6d33
  in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
f0b6d33
! It is impossible to ignore suffixes with two dots.  Examples:
f0b6d33
  
f0b6d33
    pattern:	files:				match:	~
f0b6d33
     test*	test.c test.h test.o		test.c
f0b6d33
     test*	test.h test.o			test.h and test.o
f0b6d33
     test*	test.i test.h test.c		test.i and test.c
f0b6d33
  
f0b6d33
  If there is more than one matching file (after ignoring the ones matching
f0b6d33
  the 'suffixes' option) the first file name is inserted.  You can see that
f0b6d33
  there is only one match when you type 'wildchar' twice and the completed
f0b6d33
--- 439,458 ----
f0b6d33
  those files with an extension that is in the 'suffixes' option are ignored.
f0b6d33
  The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
f0b6d33
  in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
f0b6d33
! 
f0b6d33
! An empty entry, two consecutive commas, match a file name that does not
f0b6d33
! contain a ".", thus has no suffix.  This is useful to ignore "prog" and prefer
f0b6d33
! "prog.c".
f0b6d33
! 
f0b6d33
! Examples:
f0b6d33
  
f0b6d33
    pattern:	files:				match:	~
f0b6d33
     test*	test.c test.h test.o		test.c
f0b6d33
     test*	test.h test.o			test.h and test.o
f0b6d33
     test*	test.i test.h test.c		test.i and test.c
f0b6d33
  
f0b6d33
+ It is impossible to ignore suffixes with two dots.
f0b6d33
+ 
f0b6d33
  If there is more than one matching file (after ignoring the ones matching
f0b6d33
  the 'suffixes' option) the first file name is inserted.  You can see that
f0b6d33
  there is only one match when you type 'wildchar' twice and the completed
f0b6d33
*** ../vim-7.2.233/src/misc1.c	2009-07-09 20:06:30.000000000 +0200
f0b6d33
--- src/misc1.c	2009-07-14 15:51:55.000000000 +0200
f0b6d33
***************
f0b6d33
*** 8533,8543 ****
f0b6d33
      for (setsuf = p_su; *setsuf; )
f0b6d33
      {
f0b6d33
  	setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,");
f0b6d33
! 	if (fnamelen >= setsuflen
f0b6d33
! 		&& fnamencmp(suf_buf, fname + fnamelen - setsuflen,
f0b6d33
! 					      (size_t)setsuflen) == 0)
f0b6d33
! 	    break;
f0b6d33
! 	setsuflen = 0;
f0b6d33
      }
f0b6d33
      return (setsuflen != 0);
f0b6d33
  }
f0b6d33
--- 8534,8558 ----
f0b6d33
      for (setsuf = p_su; *setsuf; )
f0b6d33
      {
f0b6d33
  	setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,");
f0b6d33
! 	if (setsuflen == 0)
f0b6d33
! 	{
f0b6d33
! 	    char_u *tail = gettail(fname);
f0b6d33
! 
f0b6d33
! 	    /* empty entry: match name without a '.' */
f0b6d33
! 	    if (vim_strchr(tail, '.') == NULL)
f0b6d33
! 	    {
f0b6d33
! 		setsuflen = 1;
f0b6d33
! 		break;
f0b6d33
! 	    }
f0b6d33
! 	}
f0b6d33
! 	else
f0b6d33
! 	{
f0b6d33
! 	    if (fnamelen >= setsuflen
f0b6d33
! 		    && fnamencmp(suf_buf, fname + fnamelen - setsuflen,
f0b6d33
! 						  (size_t)setsuflen) == 0)
f0b6d33
! 		break;
f0b6d33
! 	    setsuflen = 0;
f0b6d33
! 	}
f0b6d33
      }
f0b6d33
      return (setsuflen != 0);
f0b6d33
  }
f0b6d33
*** ../vim-7.2.233/src/version.c	2009-07-14 18:38:09.000000000 +0200
f0b6d33
--- src/version.c	2009-07-14 21:38:30.000000000 +0200
f0b6d33
***************
f0b6d33
*** 678,679 ****
f0b6d33
--- 678,681 ----
f0b6d33
  {   /* Add new patch number below this line */
f0b6d33
+ /**/
f0b6d33
+     234,
f0b6d33
  /**/
f0b6d33
f0b6d33
-- 
f0b6d33
How many light bulbs does it take to change a person?
f0b6d33
f0b6d33
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
f0b6d33
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
f0b6d33
\\\        download, build and distribute -- http://www.A-A-P.org        ///
f0b6d33
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///