comparison src/os_msdos.c @ 6695:6529590f6c43 v7.4.672

updated for version 7.4.672 Problem: When completing a shell command, directories in the current directory are not listed. Solution: When "." is not in $PATH also look in the current directory for directories.
author Bram Moolenaar <bram@vim.org>
date Sat, 21 Mar 2015 17:32:19 +0100
parents 5ab2946f7ce5
children cf744110897d
comparison
equal deleted inserted replaced
6694:c0df98c0770c 6695:6529590f6c43
2940 return TRUE; 2940 return TRUE;
2941 } 2941 }
2942 2942
2943 /* 2943 /*
2944 * Return 1 if "name" can be executed, 0 if not. 2944 * Return 1 if "name" can be executed, 0 if not.
2945 * If "use_path" is FALSE only check if "name" is executable.
2945 * Return -1 if unknown. 2946 * Return -1 if unknown.
2946 */ 2947 */
2947 int 2948 int
2948 mch_can_exe(name, path) 2949 mch_can_exe(name, path, use_path)
2949 char_u *name; 2950 char_u *name;
2950 char_u **path; 2951 char_u **path;
2952 int use_path;
2951 { 2953 {
2952 char *p; 2954 char *p;
2953 2955 int mode;
2956
2957 if (!use_path)
2958 {
2959 /* TODO: proper check if file is executable. */
2960 mode = vim_chmod(name);
2961 return mode != -1 && (mode & FA_DIREC) == 0;
2962 }
2954 p = searchpath(name); 2963 p = searchpath(name);
2955 if (p == NULL || mch_isdir(p)) 2964 if (p == NULL || mch_isdir(p))
2956 return FALSE; 2965 return FALSE;
2957 if (path != NULL) 2966 if (path != NULL)
2958 *path = vim_strsave(p); 2967 *path = vim_strsave(p);