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