From dde2559c4359338c0126950a6207e5f08114a170 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 9 Mar 2009 01:12:39 +0000 Subject: [PATCH] (Qfile_name_handler_alist): Extern it. (load_charset_map_from_file): Temporarily bind `file-name-handler-alist' to nil while calling openp. --- src/ChangeLog | 6 ++++++ src/charset.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1054979005f..24d5984d9e7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2009-03-09 Kenichi Handa + + * charset.c (Qfile_name_handler_alist): Extern it. + (load_charset_map_from_file): Temporarily bind + `file-name-handler-alist' to nil while calling openp. (Bug#2435) + 2009-03-06 Aaron Ecay (tiny change) * nsterm.m (ns_draw_vertical_window_border): Draw 1 pixel wide, diff --git a/src/charset.c b/src/charset.c index 052f3186831..1cbfa2fd497 100644 --- a/src/charset.c +++ b/src/charset.c @@ -477,6 +477,7 @@ read_hex (fp, eof) 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 @@ read_hex (fp, eof) 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 @@ load_charset_map_from_file (charset, mapfile, control_flag) 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"))) { -- 2.39.5