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