Karsten Hopp a89345
To: vim_dev@googlegroups.com
Karsten Hopp a89345
Subject: Patch 7.4.235
Karsten Hopp a89345
Fcc: outbox
Karsten Hopp a89345
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp a89345
Mime-Version: 1.0
Karsten Hopp a89345
Content-Type: text/plain; charset=UTF-8
Karsten Hopp a89345
Content-Transfer-Encoding: 8bit
Karsten Hopp a89345
------------
Karsten Hopp a89345
Karsten Hopp a89345
Patch 7.4.235
Karsten Hopp a89345
Problem:    It is not easy to get the full path of a command.
Karsten Hopp a89345
Solution:   Add the exepath() function.
Karsten Hopp a89345
Files:	    src/eval.c, src/misc1.c, src/os_amiga.c, src/os_msdos.c,
Karsten Hopp a89345
	    src/os_unix.c, src/os_vms.c, src/os_win32.c,
Karsten Hopp a89345
	    src/proto/os_amiga.pro, src/proto/os_msdos.pro,
Karsten Hopp a89345
	    src/proto/os_unix.pro, src/proto/os_win32.pro,
Karsten Hopp a89345
	    runtime/doc/eval.txt
Karsten Hopp a89345
Karsten Hopp a89345
Karsten Hopp a89345
*** ../vim-7.4.234/src/eval.c	2014-04-01 19:55:46.252787300 +0200
Karsten Hopp a89345
--- src/eval.c	2014-04-01 20:18:39.212768414 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 514,519 ****
Karsten Hopp a89345
--- 514,520 ----
Karsten Hopp a89345
  static void f_eval __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp a89345
  static void f_eventhandler __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp a89345
  static void f_executable __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp a89345
+ static void f_exepath __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp a89345
  static void f_exists __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp a89345
  #ifdef FEAT_FLOAT
Karsten Hopp a89345
  static void f_exp __ARGS((typval_T *argvars, typval_T *rettv));
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 7920,7925 ****
Karsten Hopp a89345
--- 7921,7927 ----
Karsten Hopp a89345
      {"eval",		1, 1, f_eval},
Karsten Hopp a89345
      {"eventhandler",	0, 0, f_eventhandler},
Karsten Hopp a89345
      {"executable",	1, 1, f_executable},
Karsten Hopp a89345
+     {"exepath",		1, 1, f_exepath},
Karsten Hopp a89345
      {"exists",		1, 1, f_exists},
Karsten Hopp a89345
  #ifdef FEAT_FLOAT
Karsten Hopp a89345
      {"exp",		1, 1, f_exp},
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 10046,10052 ****
Karsten Hopp a89345
      typval_T	*argvars;
Karsten Hopp a89345
      typval_T	*rettv;
Karsten Hopp a89345
  {
Karsten Hopp a89345
!     rettv->vval.v_number = mch_can_exe(get_tv_string(&argvars[0]));
Karsten Hopp a89345
  }
Karsten Hopp a89345
  
Karsten Hopp a89345
  /*
Karsten Hopp a89345
--- 10048,10069 ----
Karsten Hopp a89345
      typval_T	*argvars;
Karsten Hopp a89345
      typval_T	*rettv;
Karsten Hopp a89345
  {
Karsten Hopp a89345
!     rettv->vval.v_number = mch_can_exe(get_tv_string(&argvars[0]), NULL);
Karsten Hopp a89345
! }
Karsten Hopp a89345
! 
Karsten Hopp a89345
! /*
Karsten Hopp a89345
!  * "exepath()" function
Karsten Hopp a89345
!  */
Karsten Hopp a89345
!     static void
Karsten Hopp a89345
! f_exepath(argvars, rettv)
Karsten Hopp a89345
!     typval_T	*argvars;
Karsten Hopp a89345
!     typval_T	*rettv;
Karsten Hopp a89345
! {
Karsten Hopp a89345
!     char_u *p = NULL;
Karsten Hopp a89345
! 
Karsten Hopp a89345
!     (void)mch_can_exe(get_tv_string(&argvars[0]), &p);
Karsten Hopp a89345
!     rettv->v_type = VAR_STRING;
Karsten Hopp a89345
!     rettv->vval.v_string = p;
Karsten Hopp a89345
  }
Karsten Hopp a89345
  
Karsten Hopp a89345
  /*
Karsten Hopp a89345
*** ../vim-7.4.234/src/misc1.c	2014-03-12 18:55:52.100906804 +0100
Karsten Hopp a89345
--- src/misc1.c	2014-04-01 20:01:08.752782864 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 10728,10734 ****
Karsten Hopp a89345
  	return;
Karsten Hopp a89345
  
Karsten Hopp a89345
      /* If the file isn't executable, may not add it.  Do accept directories. */
Karsten Hopp a89345
!     if (!isdir && (flags & EW_EXEC) && !mch_can_exe(f))
Karsten Hopp a89345
  	return;
Karsten Hopp a89345
  
Karsten Hopp a89345
      /* Make room for another item in the file list. */
Karsten Hopp a89345
--- 10728,10734 ----
Karsten Hopp a89345
  	return;
Karsten Hopp a89345
  
Karsten Hopp a89345
      /* If the file isn't executable, may not add it.  Do accept directories. */
Karsten Hopp a89345
!     if (!isdir && (flags & EW_EXEC) && !mch_can_exe(f, NULL))
Karsten Hopp a89345
  	return;
Karsten Hopp a89345
  
Karsten Hopp a89345
      /* Make room for another item in the file list. */
Karsten Hopp a89345
*** ../vim-7.4.234/src/os_amiga.c	2013-05-06 04:06:04.000000000 +0200
Karsten Hopp a89345
--- src/os_amiga.c	2014-04-01 20:19:50.804767429 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 884,891 ****
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(name)
Karsten Hopp a89345
      char_u	*name;
Karsten Hopp a89345
  {
Karsten Hopp a89345
      /* TODO */
Karsten Hopp a89345
      return -1;
Karsten Hopp a89345
--- 884,892 ----
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(name, path)
Karsten Hopp a89345
      char_u	*name;
Karsten Hopp a89345
+     char_u	**path;
Karsten Hopp a89345
  {
Karsten Hopp a89345
      /* TODO */
Karsten Hopp a89345
      return -1;
Karsten Hopp a89345
*** ../vim-7.4.234/src/os_msdos.c	2014-03-23 15:12:29.931264336 +0100
Karsten Hopp a89345
--- src/os_msdos.c	2014-04-01 20:02:39.996781608 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 2945,2958 ****
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(name)
Karsten Hopp a89345
      char_u	*name;
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char	*p;
Karsten Hopp a89345
  
Karsten Hopp a89345
      p = searchpath(name);
Karsten Hopp a89345
      if (p == NULL || mch_isdir(p))
Karsten Hopp a89345
  	return FALSE;
Karsten Hopp a89345
      return TRUE;
Karsten Hopp a89345
  }
Karsten Hopp a89345
  
Karsten Hopp a89345
--- 2945,2961 ----
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(name, path)
Karsten Hopp a89345
      char_u	*name;
Karsten Hopp a89345
+     char_u	**path;
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char	*p;
Karsten Hopp a89345
  
Karsten Hopp a89345
      p = searchpath(name);
Karsten Hopp a89345
      if (p == NULL || mch_isdir(p))
Karsten Hopp a89345
  	return FALSE;
Karsten Hopp a89345
+     if (path != NULL)
Karsten Hopp a89345
+ 	*path = vim_strsave(p);
Karsten Hopp a89345
      return TRUE;
Karsten Hopp a89345
  }
Karsten Hopp a89345
  
Karsten Hopp a89345
*** ../vim-7.4.234/src/os_unix.c	2014-03-12 16:51:35.060792541 +0100
Karsten Hopp a89345
--- src/os_unix.c	2014-04-01 20:46:21.304745550 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 2992,2999 ****
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(name)
Karsten Hopp a89345
      char_u	*name;
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char_u	*buf;
Karsten Hopp a89345
      char_u	*p, *e;
Karsten Hopp a89345
--- 2992,3000 ----
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(name, path)
Karsten Hopp a89345
      char_u	*name;
Karsten Hopp a89345
+     char_u	**path;
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char_u	*buf;
Karsten Hopp a89345
      char_u	*p, *e;
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 3003,3009 ****
Karsten Hopp a89345
      if (mch_isFullName(name) || (name[0] == '.' && (name[1] == '/'
Karsten Hopp a89345
  				      || (name[1] == '.' && name[2] == '/'))))
Karsten Hopp a89345
      {
Karsten Hopp a89345
! 	return executable_file(name);
Karsten Hopp a89345
      }
Karsten Hopp a89345
  
Karsten Hopp a89345
      p = (char_u *)getenv("PATH");
Karsten Hopp a89345
--- 3004,3021 ----
Karsten Hopp a89345
      if (mch_isFullName(name) || (name[0] == '.' && (name[1] == '/'
Karsten Hopp a89345
  				      || (name[1] == '.' && name[2] == '/'))))
Karsten Hopp a89345
      {
Karsten Hopp a89345
! 	if (executable_file(name))
Karsten Hopp a89345
! 	{
Karsten Hopp a89345
! 	    if (path != NULL)
Karsten Hopp a89345
! 	    {
Karsten Hopp a89345
! 		if (name[0] == '.')
Karsten Hopp a89345
! 		    *path = FullName_save(name, TRUE);
Karsten Hopp a89345
! 		else
Karsten Hopp a89345
! 		    *path = vim_strsave(name);
Karsten Hopp a89345
! 	    }
Karsten Hopp a89345
! 	    return TRUE;
Karsten Hopp a89345
! 	}
Karsten Hopp a89345
! 	return FALSE;
Karsten Hopp a89345
      }
Karsten Hopp a89345
  
Karsten Hopp a89345
      p = (char_u *)getenv("PATH");
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 3032,3038 ****
Karsten Hopp a89345
--- 3044,3059 ----
Karsten Hopp a89345
  	STRCAT(buf, name);
Karsten Hopp a89345
  	retval = executable_file(buf);
Karsten Hopp a89345
  	if (retval == 1)
Karsten Hopp a89345
+ 	{
Karsten Hopp a89345
+ 	    if (path != NULL)
Karsten Hopp a89345
+ 	    {
Karsten Hopp a89345
+ 		if (buf[0] == '.')
Karsten Hopp a89345
+ 		    *path = FullName_save(buf, TRUE);
Karsten Hopp a89345
+ 		else
Karsten Hopp a89345
+ 		    *path = vim_strsave(buf);
Karsten Hopp a89345
+ 	    }
Karsten Hopp a89345
  	    break;
Karsten Hopp a89345
+ 	}
Karsten Hopp a89345
  
Karsten Hopp a89345
  	if (*e != ':')
Karsten Hopp a89345
  	    break;
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 5592,5598 ****
Karsten Hopp a89345
  		    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  		/* Skip files that are not executable if we check for that. */
Karsten Hopp a89345
! 		if (!dir && (flags & EW_EXEC) && !mch_can_exe(p))
Karsten Hopp a89345
  		    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  		if (--files_free == 0)
Karsten Hopp a89345
--- 5613,5619 ----
Karsten Hopp a89345
  		    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  		/* Skip files that are not executable if we check for that. */
Karsten Hopp a89345
! 		if (!dir && (flags & EW_EXEC) && !mch_can_exe(p, NULL))
Karsten Hopp a89345
  		    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  		if (--files_free == 0)
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 6090,6096 ****
Karsten Hopp a89345
  	    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	/* Skip files that are not executable if we check for that. */
Karsten Hopp a89345
! 	if (!dir && (flags & EW_EXEC) && !mch_can_exe((*file)[i]))
Karsten Hopp a89345
  	    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	p = alloc((unsigned)(STRLEN((*file)[i]) + 1 + dir));
Karsten Hopp a89345
--- 6111,6117 ----
Karsten Hopp a89345
  	    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	/* Skip files that are not executable if we check for that. */
Karsten Hopp a89345
! 	if (!dir && (flags & EW_EXEC) && !mch_can_exe((*file)[i], NULL))
Karsten Hopp a89345
  	    continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	p = alloc((unsigned)(STRLEN((*file)[i]) + 1 + dir));
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 6317,6323 ****
Karsten Hopp a89345
  
Karsten Hopp a89345
  /* Reads gpm event and adds special keys to input buf. Returns length of
Karsten Hopp a89345
   * generated key sequence.
Karsten Hopp a89345
!  * This function is made after gui_send_mouse_event
Karsten Hopp a89345
   */
Karsten Hopp a89345
      static int
Karsten Hopp a89345
  mch_gpm_process()
Karsten Hopp a89345
--- 6338,6344 ----
Karsten Hopp a89345
  
Karsten Hopp a89345
  /* Reads gpm event and adds special keys to input buf. Returns length of
Karsten Hopp a89345
   * generated key sequence.
Karsten Hopp a89345
!  * This function is styled after gui_send_mouse_event().
Karsten Hopp a89345
   */
Karsten Hopp a89345
      static int
Karsten Hopp a89345
  mch_gpm_process()
Karsten Hopp a89345
*** ../vim-7.4.234/src/os_vms.c	2014-03-12 16:51:35.060792541 +0100
Karsten Hopp a89345
--- src/os_vms.c	2014-04-01 20:05:52.960778954 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 483,489 ****
Karsten Hopp a89345
  		continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	    /* Skip files that are not executable if we check for that. */
Karsten Hopp a89345
! 	    if (!dir && (flags & EW_EXEC) && !mch_can_exe(vms_fmatch[i]))
Karsten Hopp a89345
  		continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	    /* allocate memory for pointers */
Karsten Hopp a89345
--- 483,489 ----
Karsten Hopp a89345
  		continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	    /* Skip files that are not executable if we check for that. */
Karsten Hopp a89345
! 	    if (!dir && (flags & EW_EXEC) && !mch_can_exe(vms_fmatch[i], NULL))
Karsten Hopp a89345
  		continue;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	    /* allocate memory for pointers */
Karsten Hopp a89345
*** ../vim-7.4.234/src/os_win32.c	2014-02-11 17:05:57.282217857 +0100
Karsten Hopp a89345
--- src/os_win32.c	2014-04-01 20:26:07.432762248 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 1882,1888 ****
Karsten Hopp a89345
   * TODO: Should somehow check if it's really executable.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      static int
Karsten Hopp a89345
! executable_exists(char *name)
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char	*dum;
Karsten Hopp a89345
      char	fname[_MAX_PATH];
Karsten Hopp a89345
--- 1882,1888 ----
Karsten Hopp a89345
   * TODO: Should somehow check if it's really executable.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      static int
Karsten Hopp a89345
! executable_exists(char *name, char_u **path)
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char	*dum;
Karsten Hopp a89345
      char	fname[_MAX_PATH];
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 1905,1910 ****
Karsten Hopp a89345
--- 1905,1912 ----
Karsten Hopp a89345
  		    return FALSE;
Karsten Hopp a89345
  		if (GetFileAttributesW(fnamew) & FILE_ATTRIBUTE_DIRECTORY)
Karsten Hopp a89345
  		    return FALSE;
Karsten Hopp a89345
+ 		if (path != NULL)
Karsten Hopp a89345
+ 		    *path = utf16_to_enc(fnamew, NULL);
Karsten Hopp a89345
  		return TRUE;
Karsten Hopp a89345
  	    }
Karsten Hopp a89345
  	    /* Retry with non-wide function (for Windows 98). */
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 1915,1920 ****
Karsten Hopp a89345
--- 1917,1924 ----
Karsten Hopp a89345
  	return FALSE;
Karsten Hopp a89345
      if (mch_isdir(fname))
Karsten Hopp a89345
  	return FALSE;
Karsten Hopp a89345
+     if (path != NULL)
Karsten Hopp a89345
+ 	*path = vim_strsave(fname);
Karsten Hopp a89345
      return TRUE;
Karsten Hopp a89345
  }
Karsten Hopp a89345
  
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 1996,2002 ****
Karsten Hopp a89345
  	    vimrun_path = (char *)vim_strsave(vimrun_location);
Karsten Hopp a89345
  	    s_dont_use_vimrun = FALSE;
Karsten Hopp a89345
  	}
Karsten Hopp a89345
! 	else if (executable_exists("vimrun.exe"))
Karsten Hopp a89345
  	    s_dont_use_vimrun = FALSE;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	/* Don't give the warning for a missing vimrun.exe right now, but only
Karsten Hopp a89345
--- 2000,2006 ----
Karsten Hopp a89345
  	    vimrun_path = (char *)vim_strsave(vimrun_location);
Karsten Hopp a89345
  	    s_dont_use_vimrun = FALSE;
Karsten Hopp a89345
  	}
Karsten Hopp a89345
! 	else if (executable_exists("vimrun.exe", NULL))
Karsten Hopp a89345
  	    s_dont_use_vimrun = FALSE;
Karsten Hopp a89345
  
Karsten Hopp a89345
  	/* Don't give the warning for a missing vimrun.exe right now, but only
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 2010,2016 ****
Karsten Hopp a89345
       * If "finstr.exe" doesn't exist, use "grep -n" for 'grepprg'.
Karsten Hopp a89345
       * Otherwise the default "findstr /n" is used.
Karsten Hopp a89345
       */
Karsten Hopp a89345
!     if (!executable_exists("findstr.exe"))
Karsten Hopp a89345
  	set_option_value((char_u *)"grepprg", 0, (char_u *)"grep -n", 0);
Karsten Hopp a89345
  
Karsten Hopp a89345
  #ifdef FEAT_CLIPBOARD
Karsten Hopp a89345
--- 2014,2020 ----
Karsten Hopp a89345
       * If "finstr.exe" doesn't exist, use "grep -n" for 'grepprg'.
Karsten Hopp a89345
       * Otherwise the default "findstr /n" is used.
Karsten Hopp a89345
       */
Karsten Hopp a89345
!     if (!executable_exists("findstr.exe", NULL))
Karsten Hopp a89345
  	set_option_value((char_u *)"grepprg", 0, (char_u *)"grep -n", 0);
Karsten Hopp a89345
  
Karsten Hopp a89345
  #ifdef FEAT_CLIPBOARD
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 3330,3336 ****
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(char_u *name)
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char_u	buf[_MAX_PATH];
Karsten Hopp a89345
      int		len = (int)STRLEN(name);
Karsten Hopp a89345
--- 3334,3340 ----
Karsten Hopp a89345
   * Return -1 if unknown.
Karsten Hopp a89345
   */
Karsten Hopp a89345
      int
Karsten Hopp a89345
! mch_can_exe(char_u *name, char_u **path)
Karsten Hopp a89345
  {
Karsten Hopp a89345
      char_u	buf[_MAX_PATH];
Karsten Hopp a89345
      int		len = (int)STRLEN(name);
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 3343,3349 ****
Karsten Hopp a89345
       * this with a Unix-shell like 'shell'. */
Karsten Hopp a89345
      if (vim_strchr(gettail(name), '.') != NULL
Karsten Hopp a89345
  			       || strstr((char *)gettail(p_sh), "sh") != NULL)
Karsten Hopp a89345
! 	if (executable_exists((char *)name))
Karsten Hopp a89345
  	    return TRUE;
Karsten Hopp a89345
  
Karsten Hopp a89345
      /*
Karsten Hopp a89345
--- 3347,3353 ----
Karsten Hopp a89345
       * this with a Unix-shell like 'shell'. */
Karsten Hopp a89345
      if (vim_strchr(gettail(name), '.') != NULL
Karsten Hopp a89345
  			       || strstr((char *)gettail(p_sh), "sh") != NULL)
Karsten Hopp a89345
! 	if (executable_exists((char *)name, path))
Karsten Hopp a89345
  	    return TRUE;
Karsten Hopp a89345
  
Karsten Hopp a89345
      /*
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 3365,3371 ****
Karsten Hopp a89345
  	}
Karsten Hopp a89345
  	else
Karsten Hopp a89345
  	    copy_option_part(&p, buf + len, _MAX_PATH - len, ";");
Karsten Hopp a89345
! 	if (executable_exists((char *)buf))
Karsten Hopp a89345
  	    return TRUE;
Karsten Hopp a89345
      }
Karsten Hopp a89345
      return FALSE;
Karsten Hopp a89345
--- 3369,3375 ----
Karsten Hopp a89345
  	}
Karsten Hopp a89345
  	else
Karsten Hopp a89345
  	    copy_option_part(&p, buf + len, _MAX_PATH - len, ";");
Karsten Hopp a89345
! 	if (executable_exists((char *)buf, path))
Karsten Hopp a89345
  	    return TRUE;
Karsten Hopp a89345
      }
Karsten Hopp a89345
      return FALSE;
Karsten Hopp a89345
*** ../vim-7.4.234/src/proto/os_amiga.pro	2013-08-10 13:37:37.000000000 +0200
Karsten Hopp a89345
--- src/proto/os_amiga.pro	2014-04-01 20:41:23.672749644 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 26,32 ****
Karsten Hopp a89345
  void mch_hide __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_mkdir __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  void mch_early_init __ARGS((void));
Karsten Hopp a89345
  void mch_exit __ARGS((int r));
Karsten Hopp a89345
--- 26,32 ----
Karsten Hopp a89345
  void mch_hide __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_mkdir __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name, char_u **path));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  void mch_early_init __ARGS((void));
Karsten Hopp a89345
  void mch_exit __ARGS((int r));
Karsten Hopp a89345
*** ../vim-7.4.234/src/proto/os_msdos.pro	2013-08-10 13:37:37.000000000 +0200
Karsten Hopp a89345
--- src/proto/os_msdos.pro	2014-04-01 20:41:32.432749524 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 38,44 ****
Karsten Hopp a89345
  int mch_setperm __ARGS((char_u *name, long perm));
Karsten Hopp a89345
  void mch_hide __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_dirname __ARGS((char_u *buf, int len));
Karsten Hopp a89345
  int mch_remove __ARGS((char_u *name));
Karsten Hopp a89345
--- 38,44 ----
Karsten Hopp a89345
  int mch_setperm __ARGS((char_u *name, long perm));
Karsten Hopp a89345
  void mch_hide __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name, char_u **path));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_dirname __ARGS((char_u *buf, int len));
Karsten Hopp a89345
  int mch_remove __ARGS((char_u *name));
Karsten Hopp a89345
*** ../vim-7.4.234/src/proto/os_unix.pro	2013-08-10 13:37:23.000000000 +0200
Karsten Hopp a89345
--- src/proto/os_unix.pro	2014-04-01 20:41:58.712749162 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 42,48 ****
Karsten Hopp a89345
  void mch_free_acl __ARGS((vim_acl_T aclent));
Karsten Hopp a89345
  void mch_hide __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  void mch_early_init __ARGS((void));
Karsten Hopp a89345
  void mch_free_mem __ARGS((void));
Karsten Hopp a89345
--- 42,48 ----
Karsten Hopp a89345
  void mch_free_acl __ARGS((vim_acl_T aclent));
Karsten Hopp a89345
  void mch_hide __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_isdir __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name, char_u **path));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  void mch_early_init __ARGS((void));
Karsten Hopp a89345
  void mch_free_mem __ARGS((void));
Karsten Hopp a89345
*** ../vim-7.4.234/src/proto/os_win32.pro	2013-08-10 13:37:38.000000000 +0200
Karsten Hopp a89345
--- src/proto/os_win32.pro	2014-04-01 20:42:16.992748911 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 26,32 ****
Karsten Hopp a89345
  int mch_is_linked __ARGS((char_u *fname));
Karsten Hopp a89345
  int win32_fileinfo __ARGS((char_u *fname, BY_HANDLE_FILE_INFORMATION *info));
Karsten Hopp a89345
  int mch_writable __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  vim_acl_T mch_get_acl __ARGS((char_u *fname));
Karsten Hopp a89345
  void mch_set_acl __ARGS((char_u *fname, vim_acl_T acl));
Karsten Hopp a89345
--- 26,32 ----
Karsten Hopp a89345
  int mch_is_linked __ARGS((char_u *fname));
Karsten Hopp a89345
  int win32_fileinfo __ARGS((char_u *fname, BY_HANDLE_FILE_INFORMATION *info));
Karsten Hopp a89345
  int mch_writable __ARGS((char_u *name));
Karsten Hopp a89345
! int mch_can_exe __ARGS((char_u *name, char_u **path));
Karsten Hopp a89345
  int mch_nodetype __ARGS((char_u *name));
Karsten Hopp a89345
  vim_acl_T mch_get_acl __ARGS((char_u *fname));
Karsten Hopp a89345
  void mch_set_acl __ARGS((char_u *fname, vim_acl_T acl));
Karsten Hopp a89345
*** ../vim-7.4.234/runtime/doc/eval.txt	2014-04-01 19:55:46.244787300 +0200
Karsten Hopp a89345
--- runtime/doc/eval.txt	2014-04-01 20:54:37.832738720 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 1561,1566 ****
Karsten Hopp a89345
--- 1562,1571 ----
Karsten Hopp a89345
  v:progpath	Contains the command with which Vim was invoked, including the
Karsten Hopp a89345
  		path.  Useful if you want to message a Vim server using a
Karsten Hopp a89345
  		|--remote-expr|.
Karsten Hopp a89345
+ 		To get the full path use: >
Karsten Hopp a89345
+ 			echo exepath(v:progpath)
Karsten Hopp a89345
+ <		NOTE: This does not work when the command is a relative path
Karsten Hopp a89345
+ 		and the current directory has changed.
Karsten Hopp a89345
  		Read-only.
Karsten Hopp a89345
  
Karsten Hopp a89345
  					*v:register* *register-variable*
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 1761,1766 ****
Karsten Hopp a89345
--- 1766,1772 ----
Karsten Hopp a89345
  eval( {string})			any	evaluate {string} into its value
Karsten Hopp a89345
  eventhandler( )			Number	TRUE if inside an event handler
Karsten Hopp a89345
  executable( {expr})		Number	1 if executable {expr} exists
Karsten Hopp a89345
+ exepath( {expr})		String  full path of the command {expr}
Karsten Hopp a89345
  exists( {expr})			Number	TRUE if {expr} exists
Karsten Hopp a89345
  extend( {expr1}, {expr2} [, {expr3}])
Karsten Hopp a89345
  				List/Dict insert items of {expr2} into {expr1}
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 2705,2710 ****
Karsten Hopp a89345
--- 2711,2725 ----
Karsten Hopp a89345
  			0	does not exist
Karsten Hopp a89345
  			-1	not implemented on this system
Karsten Hopp a89345
  
Karsten Hopp a89345
+ exepath({expr})						*exepath()*
Karsten Hopp a89345
+ 		If {expr} is an executable and is either an absolute path, a
Karsten Hopp a89345
+ 		relative path or found in $PATH, return the full path.
Karsten Hopp a89345
+ 		Note that the current directory is used when {expr} starts
Karsten Hopp a89345
+ 		with "./", which may be a problem for Vim: >
Karsten Hopp a89345
+ 			echo exepath(v:progpath)
Karsten Hopp a89345
+ < 		If {expr} cannot be found in $PATH or is not executable then
Karsten Hopp a89345
+ 		an empty string is returned.
Karsten Hopp a89345
+ 
Karsten Hopp a89345
  							*exists()*
Karsten Hopp a89345
  exists({expr})	The result is a Number, which is non-zero if {expr} is
Karsten Hopp a89345
  		defined, zero otherwise.  The {expr} argument is a string,
Karsten Hopp a89345
*** ../vim-7.4.234/src/version.c	2014-04-01 19:55:46.252787300 +0200
Karsten Hopp a89345
--- src/version.c	2014-04-01 20:00:44.108783203 +0200
Karsten Hopp a89345
***************
Karsten Hopp a89345
*** 736,737 ****
Karsten Hopp a89345
--- 736,739 ----
Karsten Hopp a89345
  {   /* Add new patch number below this line */
Karsten Hopp a89345
+ /**/
Karsten Hopp a89345
+     235,
Karsten Hopp a89345
  /**/
Karsten Hopp a89345
Karsten Hopp a89345
-- 
Karsten Hopp a89345
hundred-and-one symptoms of being an internet addict:
Karsten Hopp a89345
19. All of your friends have an @ in their names.
Karsten Hopp a89345
Karsten Hopp a89345
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp a89345
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp a89345
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp a89345
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///