/* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */
#undef HAVE_FD_CLOEXEC
+/* Define if /proc/self/exe can be read */
+#undef HAVE_PROC_SELF_EXE
+
/* Define if you want Cygwin to use the WIN32 clipboard, not compatible with X11*/
#undef FEAT_CYGWIN_WIN32_CLIPBOARD
{
char_u *val = argv0;
+# ifdef HAVE_PROC_SELF_EXE
+ char buf[PATH_MAX + 1];
+ ssize_t len;
+
+ len = readlink("/proc/self/exe", buf, PATH_MAX);
+ if (len > 0)
+ {
+ buf[len] = NUL;
+ val = (char_u *)buf;
+ }
+# else
/* A relative path containing a "/" will become invalid when using ":cd",
* turn it into a full path.
* On MS-Windows "vim" should be expanded to "vim.exe", thus always do
* this. */
-# ifdef WIN32
+# ifdef WIN32
char_u *path = NULL;
if (mch_can_exe(argv0, &path, FALSE) && path != NULL)
val = path;
-# else
+# else
char_u buf[MAXPATHL];
if (!mch_isFullName(argv0))