X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/de1339b0a8a5b6b8bf784c816b2b974f4610e3ac..49cdacdad393e2b9282a19a963030dfbe1a738ab:/src/dired.c diff --git a/src/dired.c b/src/dired.c index 206f370ed6..4986f84510 100644 --- a/src/dired.c +++ b/src/dired.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include @@ -102,9 +101,9 @@ static Lisp_Object directory_files_internal_unwind (Lisp_Object dh) { DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; - BLOCK_INPUT; + block_input (); closedir (d); - UNBLOCK_INPUT; + unblock_input (); return Qnil; } @@ -165,9 +164,9 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, /* 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; + block_input (); d = opendir (SSDATA (dirfilename)); - UNBLOCK_INPUT; + unblock_input (); if (d == NULL) report_file_error ("Opening directory", Fcons (directory, Qnil)); @@ -275,7 +274,7 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, /* Some bug somewhere. */ if (nchars > nbytes) - abort (); + emacs_abort (); STRING_SET_CHARS (fullname, nchars); if (nchars == nbytes) @@ -311,9 +310,9 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, } } - BLOCK_INPUT; + block_input (); closedir (d); - UNBLOCK_INPUT; + unblock_input (); #ifdef WINDOWSNT if (attrs) Vw32_get_true_file_attributes = w32_save; @@ -460,7 +459,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, Lisp_Object encoded_file; Lisp_Object encoded_dir; struct stat st; - int directoryp; + bool directoryp; /* If not INCLUDEALL, exclude files in completion-ignored-extensions as well as "." and "..". Until shown otherwise, assume we can't exclude anything. */ @@ -487,9 +486,9 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, encoded_dir = ENCODE_FILE (dirname); - BLOCK_INPUT; + block_input (); d = opendir (SSDATA (Fdirectory_file_name (encoded_dir))); - UNBLOCK_INPUT; + unblock_input (); if (!d) report_file_error ("Opening directory", Fcons (dirname, Qnil)); @@ -530,7 +529,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, if (file_name_completion_stat (encoded_dir, dp, &st) < 0) continue; - directoryp = S_ISDIR (st.st_mode); + directoryp = S_ISDIR (st.st_mode) != 0; tem = Qnil; /* If all_flag is set, always include all. It would not actually be helpful to the user to ignore any possible @@ -718,7 +717,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, /* This tests that the current file is an exact match but BESTMATCH is not (it is too long). */ if ((matchsize == SCHARS (name) - && matchsize + !!directoryp < SCHARS (bestmatch)) + && matchsize + directoryp < SCHARS (bestmatch)) || /* If there is no exact match ignoring case, prefer a match that does not change the case @@ -730,7 +729,7 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, bool all_flag, either both or neither are exact. */ (((matchsize == SCHARS (name)) == - (matchsize + !!directoryp == SCHARS (bestmatch))) + (matchsize + directoryp == SCHARS (bestmatch))) && (cmp = Fcompare_strings (name, zero, make_number (SCHARS (file)), file, zero, @@ -963,10 +962,10 @@ so last access time will always be midnight of that day. */) if (!(NILP (id_format) || EQ (id_format, Qinteger))) { - BLOCK_INPUT; + block_input (); uname = stat_uname (&s); gname = stat_gname (&s); - UNBLOCK_INPUT; + unblock_input (); } if (uname) values[2] = DECODE_SYSTEM (build_string (uname));