diff options
| author | Richard M. Stallman | 2002-12-21 17:46:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-12-21 17:46:38 +0000 |
| commit | 62e3881f1ff906ed91def2f376128e097914562b (patch) | |
| tree | 96e712a5416fcb144b8369fad7a52f7ea0f32a41 /src | |
| parent | 2bb27597b3c800f8d9771029c696cb2bcd7a6731 (diff) | |
| download | emacs-62e3881f1ff906ed91def2f376128e097914562b.tar.gz emacs-62e3881f1ff906ed91def2f376128e097914562b.zip | |
(file_name_completion): Close directory on error
Diffstat (limited to 'src')
| -rw-r--r-- | src/dired.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dired.c b/src/dired.c index 7b8a3dca552..4cb8af883b5 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -523,6 +523,10 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 523 | if (!d) | 523 | if (!d) |
| 524 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); | 524 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); |
| 525 | 525 | ||
| 526 | record_unwind_protect (directory_files_internal_unwind, | ||
| 527 | Fcons (make_number (((unsigned long) d) >> 16), | ||
| 528 | make_number (((unsigned long) d) & 0xffff))); | ||
| 529 | |||
| 526 | /* Loop reading blocks */ | 530 | /* Loop reading blocks */ |
| 527 | /* (att3b compiler bug requires do a null comparison this way) */ | 531 | /* (att3b compiler bug requires do a null comparison this way) */ |
| 528 | while (1) | 532 | while (1) |
| @@ -716,10 +720,11 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 716 | } | 720 | } |
| 717 | } | 721 | } |
| 718 | closedir (d); | 722 | closedir (d); |
| 723 | /* Discard the unwind protect. */ | ||
| 724 | specpdl_ptr = specpdl + count; | ||
| 719 | } | 725 | } |
| 720 | 726 | ||
| 721 | UNGCPRO; | 727 | UNGCPRO; |
| 722 | bestmatch = unbind_to (count, bestmatch); | ||
| 723 | 728 | ||
| 724 | if (all_flag || NILP (bestmatch)) | 729 | if (all_flag || NILP (bestmatch)) |
| 725 | { | 730 | { |
| @@ -738,6 +743,8 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 738 | 743 | ||
| 739 | quit: | 744 | quit: |
| 740 | if (d) closedir (d); | 745 | if (d) closedir (d); |
| 746 | /* Discard the unwind protect. */ | ||
| 747 | specpdl_ptr = specpdl + count; | ||
| 741 | Vquit_flag = Qnil; | 748 | Vquit_flag = Qnil; |
| 742 | return Fsignal (Qquit, Qnil); | 749 | return Fsignal (Qquit, Qnil); |
| 743 | } | 750 | } |