bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#2435: Bug 2435


From: Kenichi Handa
Subject: bug#2435: Bug 2435
Date: Mon, 09 Mar 2009 10:12:01 +0900

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

>>> AFAIK building objects is perfectly fine, yes.
>>> I wonder why you use record_unwind_protect rather than specbind, tho.
> > Don't we need record_unwind_protect for the case that quit
> > is signaled in emacs_open that is called from openp?

> specbind does the same thing (except that it's specially designed for
> the job at hand of temporarily modifying a variable).

Ah! I see.  Ok, I've just installed this change.

2009-03-09  Kenichi Handa  <address@hidden>

        * charset.c (Qfile_name_handler_alist): Extern it.
        (load_charset_map_from_file): Temporarily bind
        `file-name-handler-alist' to nil while calling openp.

Index: charset.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/charset.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -r1.169 -r1.170
--- charset.c   4 Feb 2009 01:55:07 -0000       1.169
+++ charset.c   9 Mar 2009 01:09:23 -0000       1.170
@@ -477,6 +477,7 @@
   return n;
 }
 
+extern Lisp_Object Qfile_name_handler_alist;
 
 /* Return a mapping vector for CHARSET loaded from MAPFILE.
    Each line of MAPFILE has this form
@@ -490,7 +491,10 @@
    The returned vector has this form:
        [ CODE1 CHAR1 CODE2 CHAR2 .... ]
    where CODE1 is a code-point or a cons of code-points specifying a
-   range.  */
+   range.
+
+   Note that this funciton uses `openp' to open MAPFILE but ignores
+   `file-name-handler-alist to avoid running any Lisp codes.  */
 
 extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
 
@@ -508,11 +512,14 @@
   Lisp_Object suffixes;
   struct charset_map_entries *head, *entries;
   int n_entries;
+  int count = SPECPDL_INDEX ();
 
   suffixes = Fcons (build_string (".map"),
                    Fcons (build_string (".TXT"), Qnil));
 
+  specbind (Qfile_name_handler_alist, Qnil);
   fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil);
+  unbind_to (count, Qnil);
   if (fd < 0
       || ! (fp = fdopen (fd, "r")))
     {

---
Kenichi Handa
address@hidden






reply via email to

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