diff options
| -rw-r--r-- | src/emacs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c index 792f690797d..9157cd84a99 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -746,10 +746,18 @@ load_pdump_find_executable (char const *argv0, ptrdiff_t *candidate_size) | |||
| 746 | char *candidate = NULL; | 746 | char *candidate = NULL; |
| 747 | 747 | ||
| 748 | /* If the executable name contains a slash, we have some kind of | 748 | /* If the executable name contains a slash, we have some kind of |
| 749 | path already, so just copy it. */ | 749 | path already, so just resolve symlinks and return the result. */ |
| 750 | eassert (argv0); | 750 | eassert (argv0); |
| 751 | if (strchr (argv0, DIRECTORY_SEP)) | 751 | if (strchr (argv0, DIRECTORY_SEP)) |
| 752 | { | 752 | { |
| 753 | char *real_name = realpath (argv0, NULL); | ||
| 754 | |||
| 755 | if (real_name) | ||
| 756 | { | ||
| 757 | *candidate_size = strlen (real_name) + 1; | ||
| 758 | return real_name; | ||
| 759 | } | ||
| 760 | |||
| 753 | char *val = xstrdup (argv0); | 761 | char *val = xstrdup (argv0); |
| 754 | *candidate_size = strlen (val) + 1; | 762 | *candidate_size = strlen (val) + 1; |
| 755 | return val; | 763 | return val; |