]> code.delx.au - gnu-emacs/blobdiff - src/dired.c
*** empty log message ***
[gnu-emacs] / src / dired.c
index 8b5d7851765eb79551faa008b2500e17de410931..b469d682c415b48220ffffab4aaec779d0d16b4a 100644 (file)
@@ -99,6 +99,7 @@ extern struct direct *readdir ();
 #include "charset.h"
 #include "coding.h"
 #include "regex.h"
+#include "blockinput.h"
 
 /* Returns a search buffer, with a fastmap allocated and ready to go.  */
 extern struct re_pattern_buffer *compile_pattern ();
@@ -133,7 +134,9 @@ directory_files_internal_unwind (dh)
      Lisp_Object dh;
 {
   DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer;
+  BLOCK_INPUT;
   closedir (d);
+  UNBLOCK_INPUT;
   return Qnil;
 }
 
@@ -195,7 +198,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
   /* Now *bufp is the compiled form of MATCH; don't call anything
      which might compile a new regexp until we're done with the loop!  */
 
+  BLOCK_INPUT;
   d = opendir (SDATA (dirfilename));
+  UNBLOCK_INPUT;
   if (d == NULL)
     report_file_error ("Opening directory", Fcons (directory, Qnil));
 
@@ -320,7 +325,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format)
        }
     }
 
+  BLOCK_INPUT;
   closedir (d);
+  UNBLOCK_INPUT;
 
   /* Discard the unwind protect.  */
   specpdl_ptr = specpdl + count;
@@ -507,7 +514,9 @@ file_name_completion (file, dirname, all_flag, ver_flag)
     {
       int inner_count = SPECPDL_INDEX ();
 
+      BLOCK_INPUT;
       d = opendir (SDATA (Fdirectory_file_name (encoded_dir)));
+      UNBLOCK_INPUT;
       if (!d)
        report_file_error ("Opening directory", Fcons (dirname, Qnil));
 
@@ -951,10 +960,12 @@ Elements of the attribute list are:
     }
   else
     {
+      BLOCK_INPUT;
       pw = (struct passwd *) getpwuid (s.st_uid);
       values[2] = (pw ? build_string (pw->pw_name) : make_number (s.st_uid));
       gr = (struct group *) getgrgid (s.st_gid);
       values[3] = (gr ? build_string (gr->gr_name) : make_number (s.st_gid));
+      UNBLOCK_INPUT;
     }
   values[4] = make_time (s.st_atime);
   values[5] = make_time (s.st_mtime);