unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* dired leaves open dir after signal
@ 2002-12-20 22:26 Tak Ota
  0 siblings, 0 replies; only message in thread
From: Tak Ota @ 2002-12-20 22:26 UTC (permalink / raw)


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

\f
$ 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);
  }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-20 22:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20 22:26 dired leaves open dir after signal Tak Ota

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).