emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dired leaves open dir after signal


From: Tak Ota
Subject: dired leaves open dir after signal
Date: Fri, 20 Dec 2002 14:26:21 -0800 (PST)

The following patch for dired.c fixes a problem caused by leaving open
directory unclosed in case of an exception, i.e. C-g while completing
file name in a minibuffer.

-Tak


$ diff -c pure/emacs-21.3.50/src/dired.c emacs-21.3.50/src/dired.c 
*** pure/emacs-21.3.50/src/dired.c      Wed Nov 27 21:34:22 2002
--- emacs-21.3.50/src/dired.c   Thu Dec 19 13:29:09 2002
***************
*** 523,528 ****
--- 523,532 ----
        if (!d)
        report_file_error ("Opening directory", Fcons (dirname, Qnil));
  
+       record_unwind_protect (directory_files_internal_unwind,
+                              Fcons (make_number (((unsigned long) d) >> 16),
+                                     make_number (((unsigned long) d) & 
0xffff)));
+ 
        /* Loop reading blocks */
        /* (att3b compiler bug requires do a null comparison this way) */
        while (1)
***************
*** 716,725 ****
            }
        }
        closedir (d);
      }
  
    UNGCPRO;
-   bestmatch = unbind_to (count, bestmatch);
  
    if (all_flag || NILP (bestmatch))
      {
--- 720,730 ----
            }
        }
        closedir (d);
+       /* Discard the unwind protect.  */
+       specpdl_ptr = specpdl + count;
      }
  
    UNGCPRO;
  
    if (all_flag || NILP (bestmatch))
      {
***************
*** 738,743 ****
--- 743,750 ----
  
   quit:
    if (d) closedir (d);
+   /* Discard the unwind protect.  */
+   specpdl_ptr = specpdl + count;
    Vquit_flag = Qnil;
    return Fsignal (Qquit, Qnil);
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]