From 4a09dee02e347478af9bd303808be810f57210a8 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 17 Feb 2000 08:19:21 +0000 Subject: [PATCH] (decode_mode_spec_coding): Delete superfluous code. Allocate sufficient memory for eol_str in the case that eoltype is Lisp_Int. --- src/ChangeLog | 6 +++--- src/xdisp.c | 12 +++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 26bade582a5..1a9caae17e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,8 @@ 2000-02-17 Kenichi Handa - * xdisp.c (decode_mode_spec_coding): Delete superfluous code. - Allocate sufficient memory for eol_str in the case that eoltype is - Lisp_Int. + * xdisp.c (decode_mode_spec_coding): Delete superfluous code to + avoid infinite error signaling. Allocate sufficient memory for + eol_str in the case that eoltype is Lisp_Int. 2000-02-17 Stefan Monnier diff --git a/src/xdisp.c b/src/xdisp.c index e0206ca7ad3..3a8b8b42e96 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11993,9 +11993,9 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) /* The EOL conversion we are using. */ Lisp_Object eoltype; - val = coding_system; + val = Fget (coding_system, Qcoding_system); - if (NILP (val)) /* Not yet decided. */ + if (!VECTORP (val)) /* Not yet decided. */ { if (multibyte) *buf++ = '-'; @@ -12009,13 +12009,6 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) eolvalue = Fget (coding_system, Qeol_type); - while (!NILP (val) && SYMBOLP (val)) - { - val = Fget (val, Qcoding_system); - if (NILP (eolvalue)) - eolvalue = Fget (val, Qeol_type); - } - if (multibyte) *buf++ = XFASTINT (XVECTOR (val)->contents[1]); @@ -12046,6 +12039,7 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) else if (INTEGERP (eoltype) && CHAR_VALID_P (XINT (eoltype), 0)) { + eol_str = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH); eol_str_len = CHAR_STRING (XINT (eoltype), eol_str); } else -- 2.39.5