aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2002-12-21 17:56:16 +0000
committerRichard M. Stallman2002-12-21 17:56:16 +0000
commitc3a3229c39e435b7b3744d5dc9474189d87477da (patch)
tree676f839a920623a08309e9045b5da9447a16f89a /src
parent62e3881f1ff906ed91def2f376128e097914562b (diff)
downloademacs-c3a3229c39e435b7b3744d5dc9474189d87477da.tar.gz
emacs-c3a3229c39e435b7b3744d5dc9474189d87477da.zip
(file_name_completion): Fix that change.
Delete special quit-handling code; just use QUIT.
Diffstat (limited to 'src')
-rw-r--r--src/dired.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/dired.c b/src/dired.c
index 4cb8af883b5..e1aca66ba16 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -519,6 +519,8 @@ file_name_completion (file, dirname, all_flag, ver_flag)
519 519
520 for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) 520 for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++)
521 { 521 {
522 int inner_count = SPECPDL_INDEX ();
523
522 d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); 524 d = opendir (SDATA (Fdirectory_file_name (encoded_dir)));
523 if (!d) 525 if (!d)
524 report_file_error ("Opening directory", Fcons (dirname, Qnil)); 526 report_file_error ("Opening directory", Fcons (dirname, Qnil));
@@ -543,8 +545,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
543 545
544 len = NAMLEN (dp); 546 len = NAMLEN (dp);
545 547
546 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) 548 QUIT;
547 goto quit;
548 if (! DIRENTRY_NONEMPTY (dp) 549 if (! DIRENTRY_NONEMPTY (dp)
549 || len < SCHARS (encoded_file) 550 || len < SCHARS (encoded_file)
550 || 0 <= scmp (dp->d_name, SDATA (encoded_file), 551 || 0 <= scmp (dp->d_name, SDATA (encoded_file),
@@ -719,12 +720,12 @@ file_name_completion (file, dirname, all_flag, ver_flag)
719 bestmatchsize = matchsize; 720 bestmatchsize = matchsize;
720 } 721 }
721 } 722 }
722 closedir (d); 723 /* This closes the directory. */
723 /* Discard the unwind protect. */ 724 bestmatch = unbind_to (inner_count, bestmatch);
724 specpdl_ptr = specpdl + count;
725 } 725 }
726 726
727 UNGCPRO; 727 UNGCPRO;
728 bestmatch = unbind_to (count, bestmatch);
728 729
729 if (all_flag || NILP (bestmatch)) 730 if (all_flag || NILP (bestmatch))
730 { 731 {
@@ -740,13 +741,6 @@ file_name_completion (file, dirname, all_flag, ver_flag)
740 decode it from the coding system in use. */ 741 decode it from the coding system in use. */
741 bestmatch = DECODE_FILE (bestmatch); 742 bestmatch = DECODE_FILE (bestmatch);
742 return bestmatch; 743 return bestmatch;
743
744 quit:
745 if (d) closedir (d);
746 /* Discard the unwind protect. */
747 specpdl_ptr = specpdl + count;
748 Vquit_flag = Qnil;
749 return Fsignal (Qquit, Qnil);
750} 744}
751 745
752/* Compare exactly LEN chars of strings at S1 and S2, 746/* Compare exactly LEN chars of strings at S1 and S2,