# HG changeset patch # User Richard M. Stallman # Date 1040493376 0 # Node ID 141c4fba25c08f9f1385a50b17235cbbf691abce # Parent 0d51b82bd792b90911b620ebb73f704629932462 (file_name_completion): Fix that change. Delete special quit-handling code; just use QUIT. diff -r 0d51b82bd792 -r 141c4fba25c0 src/dired.c --- a/src/dired.c Sat Dec 21 17:46:38 2002 +0000 +++ b/src/dired.c Sat Dec 21 17:56:16 2002 +0000 @@ -519,6 +519,8 @@ for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) { + int inner_count = SPECPDL_INDEX (); + d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); if (!d) report_file_error ("Opening directory", Fcons (dirname, Qnil)); @@ -543,8 +545,7 @@ len = NAMLEN (dp); - if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) - goto quit; + QUIT; if (! DIRENTRY_NONEMPTY (dp) || len < SCHARS (encoded_file) || 0 <= scmp (dp->d_name, SDATA (encoded_file), @@ -719,12 +720,12 @@ bestmatchsize = matchsize; } } - closedir (d); - /* Discard the unwind protect. */ - specpdl_ptr = specpdl + count; + /* This closes the directory. */ + bestmatch = unbind_to (inner_count, bestmatch); } UNGCPRO; + bestmatch = unbind_to (count, bestmatch); if (all_flag || NILP (bestmatch)) { @@ -740,13 +741,6 @@ decode it from the coding system in use. */ bestmatch = DECODE_FILE (bestmatch); return bestmatch; - - quit: - if (d) closedir (d); - /* Discard the unwind protect. */ - specpdl_ptr = specpdl + count; - Vquit_flag = Qnil; - return Fsignal (Qquit, Qnil); } /* Compare exactly LEN chars of strings at S1 and S2,