mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
Treat ‘.../emacs’ like ‘emacs’ in realpath startup
* src/emacs.c (find_emacs_executable): If the executable name contains a slash, use the same optimization for symlink resolution that we already use when the executable name has no slash.
This commit is contained in:
parent
67ea9485a6
commit
d59fe6dad5
1 changed files with 5 additions and 9 deletions
14
src/emacs.c
14
src/emacs.c
|
|
@ -767,15 +767,11 @@ find_emacs_executable (char const *argv0, ptrdiff_t *candidate_size)
|
||||||
eassert (argv0);
|
eassert (argv0);
|
||||||
if (strchr (argv0, DIRECTORY_SEP))
|
if (strchr (argv0, DIRECTORY_SEP))
|
||||||
{
|
{
|
||||||
char *real_name = realpath (argv0, NULL);
|
char *val = (readlink (argv0, linkbuf, sizeof linkbuf) < 0
|
||||||
|
? NULL
|
||||||
if (real_name)
|
: realpath (argv0, NULL));
|
||||||
{
|
if (!val)
|
||||||
*candidate_size = strlen (real_name) + 1;
|
val = xstrdup (argv0);
|
||||||
return real_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *val = xstrdup (argv0);
|
|
||||||
*candidate_size = strlen (val) + 1;
|
*candidate_size = strlen (val) + 1;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue