unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tak Ota <Takaaki.Ota@am.sony.com>
Subject: dired leaves open dir after signal
Date: Fri, 20 Dec 2002 14:26:21 -0800 (PST)	[thread overview]
Message-ID: <20021220.142621.107708847.Takaaki.Ota@am.sony.com> (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);
  }

                 reply	other threads:[~2002-12-20 22:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021220.142621.107708847.Takaaki.Ota@am.sony.com \
    --to=takaaki.ota@am.sony.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).