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