summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-09-05 01:12:25 +0000
committerKarl Heuer <kwzh@gnu.org>1994-09-05 01:12:25 +0000
commit1cf63ddd35b9818527c112e2d6a11f948def49de (patch)
tree72f2942dcd9e0488bdbad5068a4ebf2dd7f942b8 /src/fileio.c
parent95b668962ce799120c6c9c0533579220b23bb4b4 (diff)
downloademacs-1cf63ddd35b9818527c112e2d6a11f948def49de.tar.gz
(Ffile_accessible_directory_p): Put back the gcpro.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 4a1fe76bdd1..1654d350ca2 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2383,6 +2383,7 @@ searchable directory.")
{
Lisp_Object handler;
int tem;
+ struct gcpro gcpro1;
/* If the file name has special constructs in it,
call the corresponding file handler. */
@@ -2390,10 +2391,16 @@ searchable directory.")
if (!NILP (handler))
return call2 (handler, Qfile_accessible_directory_p, filename);
- /* Need to gcpro in case the first function call has a handler that
- causes filename to be relocated. */
+ /* It's an unlikely combination, but yes we really do need to gcpro:
+ Suppose that file-accessible-directory-p has no handler, but
+ file-directory-p does have a handler; this handler causes a GC which
+ relocates the string in `filename'; and finally file-directory-p
+ returns non-nil. Then we would end up passing a garbaged string
+ to file-executable-p. */
+ GCPRO1 (filename);
tem = (NILP (Ffile_directory_p (filename))
|| NILP (Ffile_executable_p (filename)));
+ UNGCPRO;
return tem ? Qnil : Qt;
}