0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.0464: can't find executable name on Solaris and FreeBSD

Problem:    Can't find executable name on Solaris and FreeBSD.
Solution:   Check for "/proc/self/path/a.out". (Danek Duvall) And for
            "/proc/curproc/file".
This commit is contained in:
Bram Moolenaar
2017-03-16 15:13:45 +01:00
parent 0f39a82b07
commit f3757f0c87
5 changed files with 35 additions and 14 deletions

View File

@@ -3539,11 +3539,11 @@ set_progpath(char_u *argv0)
{
char_u *val = argv0;
# ifdef HAVE_PROC_SELF_EXE
# ifdef PROC_EXE_LINK
char buf[PATH_MAX + 1];
ssize_t len;
len = readlink("/proc/self/exe", buf, PATH_MAX);
len = readlink(PROC_EXE_LINK, buf, PATH_MAX);
if (len > 0)
{
buf[len] = NUL;