From: tomo Date: Tue, 14 Sep 2004 10:20:35 +0000 (+0000) Subject: Add EXFUN for `Fregexp_quote'. X-Git-Tag: r21-4-15-u2km-0_21-32-a~2^2~285 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f76180030f187b699047094892c74266ed66f47;p=chise%2Fxemacs-chise.git Add EXFUN for `Fregexp_quote'. (decode_add_er_char): Fix problem about infinite loop when a CCS specified in `coded-charset-entity-reference-alist' is not existed. --- diff --git a/src/text-coding.c b/src/text-coding.c index 9b6e7dc..b3f80ff 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -3246,6 +3246,8 @@ decode_flush_er_chars (struct decoding_stream *str, unsigned_char_dynarr* dst) } } +EXFUN (Fregexp_quote, 1); + void decode_add_er_char (struct decoding_stream *str, Emchar character, unsigned_char_dynarr* dst); void @@ -3267,7 +3269,7 @@ decode_add_er_char (struct decoding_stream *str, Emchar c, { Lisp_Object string = make_string (str->er_buf, str->er_counter); - Lisp_Object rest = Vcoded_charset_entity_reference_alist; + Lisp_Object rest; Lisp_Object cell; Lisp_Object ret; Lisp_Object pat; @@ -3275,7 +3277,8 @@ decode_add_er_char (struct decoding_stream *str, Emchar c, Lisp_Object char_type; int base; - while (!NILP (rest)) + for ( rest = Vcoded_charset_entity_reference_alist; + !NILP (rest); rest = Fcdr (rest) ) { cell = Fcar (rest); ccs = Fcar (cell); @@ -3337,7 +3340,6 @@ decode_add_er_char (struct decoding_stream *str, Emchar c, DECODE_ADD_UCS_CHAR (chr, dst); goto decoded; } - rest = Fcdr (rest); } if (!NILP (Fstring_match (build_string ("^&MCS-\\([0-9A-F]+\\)$"), string, Qnil, Qnil)))