summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-03-12 16:51:55 +0100
committerBram Moolenaar <Bram@vim.org>2014-03-12 16:51:55 +0100
commit206f011829920e41c4d3782af7591da6e1b86655 (patch)
treee244183206e3bcf82829738bf2d0eca05c7f4baf /src/os_unix.c
parentf7dc2b551708315a833fcb19c288759c277dcfe1 (diff)
downloadvim-git-206f011829920e41c4d3782af7591da6e1b86655.tar.gz
updated for version 7.4.197v7.4.197
Problem: Various problems on VMS. Solution: Fix several VMS problems. (Zoltan Arpadffy)
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 784c5a3b1..48f45b0eb 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -2965,7 +2965,26 @@ executable_file(name)
if (stat((char *)name, &st))
return 0;
+#ifdef VMS
+ /* Like on Unix system file can have executable rights but not necessarily
+ * be an executable, but on Unix is not a default for an ordianry file to
+ * have an executable flag - on VMS it is in most cases.
+ * Therefore, this check does not have any sense - let keep us to the
+ * conventions instead:
+ * *.COM and *.EXE files are the executables - the rest are not. This is
+ * not ideal but better then it was.
+ */
+ int vms_executable = 0;
+ if (S_ISREG(st.st_mode) && mch_access((char *)name, X_OK) == 0)
+ {
+ if (strstr(vms_tolower((char*)name),".exe") != NULL
+ || strstr(vms_tolower((char*)name),".com")!= NULL)
+ vms_executable = 1;
+ }
+ return vms_executable;
+#else
return S_ISREG(st.st_mode) && mch_access((char *)name, X_OK) == 0;
+#endif
}
/*
@@ -2983,7 +3002,9 @@ mch_can_exe(name)
/* If it's an absolute or relative path don't need to use $PATH. */
if (mch_isFullName(name) || (name[0] == '.' && (name[1] == '/'
|| (name[1] == '.' && name[2] == '/'))))
+ {
return executable_file(name);
+ }
p = (char_u *)getenv("PATH");
if (p == NULL || *p == NUL)