diff options
| author | Eli Zaretskii | 2021-04-07 19:43:59 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-04-07 19:43:59 +0300 |
| commit | a9b9ada6bf5e07da75ddeba6fd985e28987b767b (patch) | |
| tree | 002c6edc14076bcaef0abbf1e04da36c50f8f244 /src | |
| parent | 1f8d75160a27396da363384018a362e04aaea0bd (diff) | |
| download | emacs-a9b9ada6bf5e07da75ddeba6fd985e28987b767b.tar.gz emacs-a9b9ada6bf5e07da75ddeba6fd985e28987b767b.zip | |
Fix crash on MS-Windows caused by recent changes
* src/pdumper.c (dump_do_dump_relocation): Don't use
expand-file-name, as this crashes on MS-Windows. Use
file_access_p instead of emacs_fopen.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pdumper.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pdumper.c b/src/pdumper.c index 9b750a33f36..dc893c59bfa 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -5276,12 +5276,13 @@ dump_do_dump_relocation (const uintptr_t dump_base, | |||
| 5276 | /* Check just once if this is a local build or Emacs was installed. */ | 5276 | /* Check just once if this is a local build or Emacs was installed. */ |
| 5277 | if (installation_state == UNKNOWN) | 5277 | if (installation_state == UNKNOWN) |
| 5278 | { | 5278 | { |
| 5279 | /* Can't use expand-file-name here, because we are too | ||
| 5280 | early in the startup, and we will crash at least on | ||
| 5281 | WINDOWSNT. */ | ||
| 5279 | Lisp_Object fname = | 5282 | Lisp_Object fname = |
| 5280 | Fexpand_file_name (XCAR (comp_u->file), Vinvocation_directory); | 5283 | concat2 (Vinvocation_directory, XCAR (comp_u->file)); |
| 5281 | FILE *file; | 5284 | if (file_access_p (SSDATA (ENCODE_FILE (fname)), F_OK)) |
| 5282 | if ((file = emacs_fopen (SSDATA (ENCODE_FILE (fname)), "r"))) | ||
| 5283 | { | 5285 | { |
| 5284 | fclose (file); | ||
| 5285 | installation_state = INSTALLED; | 5286 | installation_state = INSTALLED; |
| 5286 | fixup_eln_load_path (XCAR (comp_u->file)); | 5287 | fixup_eln_load_path (XCAR (comp_u->file)); |
| 5287 | } | 5288 | } |
| @@ -5293,10 +5294,10 @@ dump_do_dump_relocation (const uintptr_t dump_base, | |||
| 5293 | } | 5294 | } |
| 5294 | 5295 | ||
| 5295 | comp_u->file = | 5296 | comp_u->file = |
| 5296 | Fexpand_file_name (installation_state == INSTALLED | 5297 | concat2 (Vinvocation_directory, |
| 5297 | ? XCAR (comp_u->file) : XCDR (comp_u->file), | 5298 | installation_state == INSTALLED |
| 5298 | Vinvocation_directory); | 5299 | ? XCAR (comp_u->file) : XCDR (comp_u->file)); |
| 5299 | comp_u->handle = dynlib_open (SSDATA (comp_u->file)); | 5300 | comp_u->handle = dynlib_open (SSDATA (ENCODE_FILE (comp_u->file))); |
| 5300 | if (!comp_u->handle) | 5301 | if (!comp_u->handle) |
| 5301 | error ("%s", dynlib_error ()); | 5302 | error ("%s", dynlib_error ()); |
| 5302 | load_comp_unit (comp_u, true, false); | 5303 | load_comp_unit (comp_u, true, false); |