startup: v:progpath fallback: path_guess_exepath

If procfs is missing then libuv cannot find the exe path.
Fallback to path_guess_exepath(), adapted from Vim findYourself().

Closes #6734
This commit is contained in:
Justin M. Keyes
2017-05-13 18:17:21 +02:00
parent 6e4e70f51b
commit 4c5398bc40
6 changed files with 109 additions and 8 deletions

View File

@@ -1223,7 +1223,8 @@ static void init_path(char *exename)
size_t exepathlen = MAXPATHL;
// Make v:progpath absolute.
if (os_exepath(exepath, &exepathlen) != 0) {
EMSG2(e_intern2, "init_path()");
// Fall back to argv[0]. Missing procfs? #6734
path_guess_exepath(exename, exepath, sizeof(exepath));
}
set_vim_var_string(VV_PROGPATH, exepath, -1);
set_vim_var_string(VV_PROGNAME, (char *)path_tail((char_u *)exename), -1);