From a3911e8c0ad15d6f571d7447474e31b35e7e670d Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 6 Dec 2005 07:39:37 +0000 Subject: [PATCH] (internal_delete_file, Fread_file_name_internal): Avoid dangerous side effects in NILP argument. --- src/fileio.c | 14 ++++++++++---- 1 file 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 internal_delete_file (filename) Lisp_Object filename; { - return NILP (internal_condition_case_1 (Fdelete_file, filename, - Qt, internal_delete_file_1)); + Lisp_Object tem; + tem = internal_condition_case_1 (Fdelete_file, filename, + Qt, internal_delete_file_1); + return NILP (tem); } 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 #endif { /* Must do it the hard (and slow) way. */ + Lisp_Object tem; GCPRO3 (all, comp, specdir); count = SPECPDL_INDEX (); record_unwind_protect (read_file_name_cleanup, current_buffer->directory); current_buffer->directory = realdir; for (comp = Qnil; CONSP (all); all = XCDR (all)) - if (!NILP (call1 (Vread_file_name_predicate, XCAR (all)))) - comp = Fcons (XCAR (all), comp); + { + tem = call1 (Vread_file_name_predicate, XCAR (all)); + if (!NILP (tem)) + comp = Fcons (XCAR (all), comp); + } unbind_to (count, Qnil); UNGCPRO; } -- 2.39.5