diff options
| author | Andrea Corallo | 2020-10-06 17:44:13 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-10-06 18:01:56 +0200 |
| commit | 4a1bb4626053d5be5d3e869d6b7049dc3269d812 (patch) | |
| tree | b5378f1fd098f4341d6c0d1ccb5ddf1d71c376d5 /src | |
| parent | 29f7024b6cfc01d6cae10603733b35784b4e4aef (diff) | |
| download | emacs-4a1bb4626053d5be5d3e869d6b7049dc3269d812.tar.gz emacs-4a1bb4626053d5be5d3e869d6b7049dc3269d812.zip | |
* Native compiling do not target a directory with no write permission
* src/comp.c (Fcomp_el_to_eln_filename): Check for write
permission while choosing the output directory in
`comp-eln-load-path'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/comp.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/comp.c b/src/comp.c index 076236ef80c..ba4089e5aeb 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -4080,8 +4080,22 @@ If BASE-DIR is nil use the first entry in `comp-eln-load-path'. */) | |||
| 4080 | separator); | 4080 | separator); |
| 4081 | Lisp_Object hash = concat3 (path_hash, separator, content_hash); | 4081 | Lisp_Object hash = concat3 (path_hash, separator, content_hash); |
| 4082 | filename = concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX)); | 4082 | filename = concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX)); |
| 4083 | |||
| 4084 | /* If base_dir was not specified search inside Vcomp_eln_load_path | ||
| 4085 | for the first directory where we have write access. */ | ||
| 4083 | if (NILP (base_dir)) | 4086 | if (NILP (base_dir)) |
| 4084 | base_dir = XCAR (Vcomp_eln_load_path); | 4087 | { |
| 4088 | Lisp_Object eln_load_paths = Vcomp_eln_load_path; | ||
| 4089 | FOR_EACH_TAIL (eln_load_paths) | ||
| 4090 | if (!NILP (Ffile_writable_p (XCAR (eln_load_paths)))) | ||
| 4091 | { | ||
| 4092 | base_dir = XCAR (eln_load_paths); | ||
| 4093 | break; | ||
| 4094 | } | ||
| 4095 | /* If we can't find it return Nil. */ | ||
| 4096 | if (NILP (base_dir)) | ||
| 4097 | return Qnil; | ||
| 4098 | } | ||
| 4085 | 4099 | ||
| 4086 | if (!file_name_absolute_p (SSDATA (base_dir))) | 4100 | if (!file_name_absolute_p (SSDATA (base_dir))) |
| 4087 | base_dir = Fexpand_file_name (base_dir, Vinvocation_directory); | 4101 | base_dir = Fexpand_file_name (base_dir, Vinvocation_directory); |