]> code.delx.au - gnu-emacs/blobdiff - src/dired.c
Make gnutls-peer-status return even more data
[gnu-emacs] / src / dired.c
index d3fe5b4943de727b5a922cb306a42baf54458fb3..8afba247e6166bda1a1aa9ece53d84f54da92a69 100644 (file)
@@ -150,6 +150,12 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
   Lisp_Object w32_save = Qnil;
 #endif
 
+  /* Don't let the compiler optimize away all copies of DIRECTORY,
+     which would break GC; see Bug#16986.  Although this is required
+     only in the common case where GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS,
+     it shouldn't break anything in the other cases.  */
+  Lisp_Object volatile directory_volatile = directory;
+
   /* Because of file name handlers, these functions might call
      Ffuncall, and cause a GC.  */
   list = encoded_directory = dirfilename = Qnil;
@@ -325,6 +331,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full,
     list = Fsort (Fnreverse (list),
                  attrs ? Qfile_attributes_lessp : Qstring_lessp);
 
+  (void) directory_volatile;
   RETURN_UNGCPRO (list);
 }
 
@@ -902,7 +909,10 @@ so last access time will always be midnight of that day.  */)
   Lisp_Object encoded;
   Lisp_Object handler;
 
-  filename = Fexpand_file_name (filename, Qnil);
+  filename = internal_condition_case_2 (Fexpand_file_name, filename, Qnil,
+                                       Qt, Fidentity);
+  if (!STRINGP (filename))
+    return Qnil;
 
   /* If the file name has special constructs in it,
      call the corresponding file handler.  */