diff options
| author | Ken Raeburn | 2005-12-06 07:39:37 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2005-12-06 07:39:37 +0000 |
| commit | a3911e8c0ad15d6f571d7447474e31b35e7e670d (patch) | |
| tree | 01b6e1663d440b5dffaeebf4ba7a036c2447c5dc /src | |
| parent | 21ed6de35b788d80e8d65cccc5ccff1b8b93b140 (diff) | |
| download | emacs-a3911e8c0ad15d6f571d7447474e31b35e7e670d.tar.gz emacs-a3911e8c0ad15d6f571d7447474e31b35e7e670d.zip | |
(internal_delete_file, Fread_file_name_internal): Avoid dangerous side effects in NILP argument.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c index 20e19255da8..c62ddd36767 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2730,8 +2730,10 @@ int | |||
| 2730 | internal_delete_file (filename) | 2730 | internal_delete_file (filename) |
| 2731 | Lisp_Object filename; | 2731 | Lisp_Object filename; |
| 2732 | { | 2732 | { |
| 2733 | return NILP (internal_condition_case_1 (Fdelete_file, filename, | 2733 | Lisp_Object tem; |
| 2734 | Qt, internal_delete_file_1)); | 2734 | tem = internal_condition_case_1 (Fdelete_file, filename, |
| 2735 | Qt, internal_delete_file_1); | ||
| 2736 | return NILP (tem); | ||
| 2735 | } | 2737 | } |
| 2736 | 2738 | ||
| 2737 | DEFUN ("rename-file", Frename_file, Srename_file, 2, 3, | 2739 | DEFUN ("rename-file", Frename_file, Srename_file, 2, 3, |
| @@ -6234,13 +6236,17 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 6234 | #endif | 6236 | #endif |
| 6235 | { | 6237 | { |
| 6236 | /* Must do it the hard (and slow) way. */ | 6238 | /* Must do it the hard (and slow) way. */ |
| 6239 | Lisp_Object tem; | ||
| 6237 | GCPRO3 (all, comp, specdir); | 6240 | GCPRO3 (all, comp, specdir); |
| 6238 | count = SPECPDL_INDEX (); | 6241 | count = SPECPDL_INDEX (); |
| 6239 | record_unwind_protect (read_file_name_cleanup, current_buffer->directory); | 6242 | record_unwind_protect (read_file_name_cleanup, current_buffer->directory); |
| 6240 | current_buffer->directory = realdir; | 6243 | current_buffer->directory = realdir; |
| 6241 | for (comp = Qnil; CONSP (all); all = XCDR (all)) | 6244 | for (comp = Qnil; CONSP (all); all = XCDR (all)) |
| 6242 | if (!NILP (call1 (Vread_file_name_predicate, XCAR (all)))) | 6245 | { |
| 6243 | comp = Fcons (XCAR (all), comp); | 6246 | tem = call1 (Vread_file_name_predicate, XCAR (all)); |
| 6247 | if (!NILP (tem)) | ||
| 6248 | comp = Fcons (XCAR (all), comp); | ||
| 6249 | } | ||
| 6244 | unbind_to (count, Qnil); | 6250 | unbind_to (count, Qnil); |
| 6245 | UNGCPRO; | 6251 | UNGCPRO; |
| 6246 | } | 6252 | } |