Commit fa65c044 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Improve detection of pdumper file and *.eln files

* src/emacs.c (load_pdump_find_executable): Resolve symlinks even
if argv[0] includes leading directories.  (Bug#46790)
parent 592ffd35
Pipeline #10696 failed with stages
in 167 minutes and 52 seconds
......@@ -746,10 +746,18 @@ load_pdump_find_executable (char const *argv0, ptrdiff_t *candidate_size)
char *candidate = NULL;
/* If the executable name contains a slash, we have some kind of
path already, so just copy it. */
path already, so just resolve symlinks and return the result. */
eassert (argv0);
if (strchr (argv0, DIRECTORY_SEP))
{
char *real_name = realpath (argv0, NULL);
if (real_name)
{
*candidate_size = strlen (real_name) + 1;
return real_name;
}
char *val = xstrdup (argv0);
*candidate_size = strlen (val) + 1;
return val;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment