Karsten Hopp bd3352
To: vim_dev@googlegroups.com
Karsten Hopp bd3352
Subject: Patch 7.4.674
Karsten Hopp bd3352
Fcc: outbox
Karsten Hopp bd3352
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp bd3352
Mime-Version: 1.0
Karsten Hopp bd3352
Content-Type: text/plain; charset=UTF-8
Karsten Hopp bd3352
Content-Transfer-Encoding: 8bit
Karsten Hopp bd3352
------------
Karsten Hopp bd3352
Karsten Hopp bd3352
Patch 7.4.674 (after 7.4.672)
Karsten Hopp bd3352
Problem:    Missing changes in one file.
Karsten Hopp bd3352
Solution:   Also change the win32 file.
Karsten Hopp bd3352
Files:	    src/os_win32.c
Karsten Hopp bd3352
Karsten Hopp bd3352
Karsten Hopp bd3352
*** ../vim-7.4.673/src/os_win32.c	2015-01-20 19:39:31.651524062 +0100
Karsten Hopp bd3352
--- src/os_win32.c	2015-03-21 16:56:22.139160233 +0100
Karsten Hopp bd3352
***************
Karsten Hopp bd3352
*** 3378,3387 ****
Karsten Hopp bd3352
  
Karsten Hopp bd3352
  /*
Karsten Hopp bd3352
   * Return 1 if "name" can be executed, 0 if not.
Karsten Hopp bd3352
   * Return -1 if unknown.
Karsten Hopp bd3352
   */
Karsten Hopp bd3352
      int
Karsten Hopp bd3352
! mch_can_exe(char_u *name, char_u **path)
Karsten Hopp bd3352
  {
Karsten Hopp bd3352
      char_u	buf[_MAX_PATH];
Karsten Hopp bd3352
      int		len = (int)STRLEN(name);
Karsten Hopp bd3352
--- 3378,3388 ----
Karsten Hopp bd3352
  
Karsten Hopp bd3352
  /*
Karsten Hopp bd3352
   * Return 1 if "name" can be executed, 0 if not.
Karsten Hopp bd3352
+  * If "use_path" is FALSE only check if "name" is executable.
Karsten Hopp bd3352
   * Return -1 if unknown.
Karsten Hopp bd3352
   */
Karsten Hopp bd3352
      int
Karsten Hopp bd3352
! mch_can_exe(char_u *name, char_u **path, int use_path)
Karsten Hopp bd3352
  {
Karsten Hopp bd3352
      char_u	buf[_MAX_PATH];
Karsten Hopp bd3352
      int		len = (int)STRLEN(name);
Karsten Hopp bd3352
***************
Karsten Hopp bd3352
*** 3389,3394 ****
Karsten Hopp bd3352
--- 3390,3400 ----
Karsten Hopp bd3352
  
Karsten Hopp bd3352
      if (len >= _MAX_PATH)	/* safety check */
Karsten Hopp bd3352
  	return FALSE;
Karsten Hopp bd3352
+     if (!use_path)
Karsten Hopp bd3352
+     {
Karsten Hopp bd3352
+ 	/* TODO: check if file is really executable. */
Karsten Hopp bd3352
+ 	return mch_getperm(name) != -1 && !mch_isdir(name);
Karsten Hopp bd3352
+     }
Karsten Hopp bd3352
  
Karsten Hopp bd3352
      /* If there already is an extension try using the name directly.  Also do
Karsten Hopp bd3352
       * this with a Unix-shell like 'shell'. */
Karsten Hopp bd3352
*** ../vim-7.4.673/src/version.c	2015-03-21 21:46:07.566423633 +0100
Karsten Hopp bd3352
--- src/version.c	2015-03-21 22:16:29.749822253 +0100
Karsten Hopp bd3352
***************
Karsten Hopp bd3352
*** 743,744 ****
Karsten Hopp bd3352
--- 743,746 ----
Karsten Hopp bd3352
  {   /* Add new patch number below this line */
Karsten Hopp bd3352
+ /**/
Karsten Hopp bd3352
+     674,
Karsten Hopp bd3352
  /**/
Karsten Hopp bd3352
Karsten Hopp bd3352
-- 
Karsten Hopp bd3352
Advice to worms:  Sleep late.
Karsten Hopp bd3352
Karsten Hopp bd3352
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp bd3352
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp bd3352
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp bd3352
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///