mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-16 10:50:49 -08:00
* src/emacs.c (load_pdump): Propery handle case when executable
wasn't found.
This commit is contained in:
parent
b560ce3560
commit
a78af3018e
1 changed files with 7 additions and 3 deletions
10
src/emacs.c
10
src/emacs.c
|
|
@ -867,13 +867,17 @@ load_pdump (int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Where's our executable? */
|
/* Where's our executable? */
|
||||||
ptrdiff_t exec_bufsize, needed;
|
ptrdiff_t exec_bufsize, bufsize, needed;
|
||||||
emacs_executable = load_pdump_find_executable (argv[0], &exec_bufsize);
|
emacs_executable = load_pdump_find_executable (argv[0], &exec_bufsize);
|
||||||
|
|
||||||
/* If we couldn't find our executable, go straight to looking for
|
/* If we couldn't find our executable, go straight to looking for
|
||||||
the dump in the hardcoded location. */
|
the dump in the hardcoded location. */
|
||||||
if (!(emacs_executable && *emacs_executable))
|
if (!(emacs_executable && *emacs_executable))
|
||||||
goto hardcoded;
|
{
|
||||||
|
bufsize = 0;
|
||||||
|
dump_file = NULL;
|
||||||
|
goto hardcoded;
|
||||||
|
}
|
||||||
|
|
||||||
if (dump_file)
|
if (dump_file)
|
||||||
{
|
{
|
||||||
|
|
@ -901,7 +905,7 @@ load_pdump (int argc, char **argv)
|
||||||
strip_suffix_length))
|
strip_suffix_length))
|
||||||
exenamelen = prefix_length;
|
exenamelen = prefix_length;
|
||||||
}
|
}
|
||||||
ptrdiff_t bufsize = exenamelen + strlen (suffix) + 1;
|
bufsize = exenamelen + strlen (suffix) + 1;
|
||||||
dump_file = xpalloc (NULL, &bufsize, 1, -1, 1);
|
dump_file = xpalloc (NULL, &bufsize, 1, -1, 1);
|
||||||
memcpy (dump_file, emacs_executable, exenamelen);
|
memcpy (dump_file, emacs_executable, exenamelen);
|
||||||
strcpy (dump_file + exenamelen, suffix);
|
strcpy (dump_file + exenamelen, suffix);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue