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

@@ -196,11 +196,13 @@ int os_nodetype(const char *name)
}
/// Gets the absolute path of the currently running executable.
/// May fail if procfs is missing. #6734
/// @see path_exepath
///
/// @param[out] buffer Returns the path string.
/// @param[out] buffer Full path to the executable.
/// @param[in] size Size of `buffer`.
///
/// @return `0` on success, or libuv error code on failure.
/// @return 0 on success, or libuv error code.
int os_exepath(char *buffer, size_t *size)
FUNC_ATTR_NONNULL_ALL
{