Commit a3911e8c authored by Ken Raeburn's avatar Ken Raeburn
Browse files

(internal_delete_file, Fread_file_name_internal): Avoid dangerous side effects in NILP argument.

parent 21ed6de3
......@@ -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
/* 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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment