Commit ace46dfe authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(openp): Prevent temporary string passed to

Ffile_readable_p from being garbage collected.
parent 7bc3ff79
...@@ -900,9 +900,12 @@ openp (path, str, suffix, storeptr, exec_only) ...@@ -900,9 +900,12 @@ openp (path, str, suffix, storeptr, exec_only)
int want_size; int want_size;
Lisp_Object filename; Lisp_Object filename;
struct stat st; struct stat st;
struct gcpro gcpro1; struct gcpro gcpro1, gcpro2;
Lisp_Object string;
GCPRO1 (str); string = Qnil;
GCPRO2 (str, string);
if (storeptr) if (storeptr)
*storeptr = Qnil; *storeptr = Qnil;
...@@ -967,7 +970,6 @@ openp (path, str, suffix, storeptr, exec_only) ...@@ -967,7 +970,6 @@ openp (path, str, suffix, storeptr, exec_only)
handler = Ffind_file_name_handler (filename, Qfile_exists_p); handler = Ffind_file_name_handler (filename, Qfile_exists_p);
if (! NILP (handler) && ! exec_only) if (! NILP (handler) && ! exec_only)
{ {
Lisp_Object string;
int exists; int exists;
string = build_string (fn); string = build_string (fn);
......
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