Mercurial > emacs
comparison src/xdisp.c @ 27721:c2a9f4621f9a
(decode_mode_spec_coding): Delete superfluous code.
Allocate sufficient memory for eol_str in the case that eoltype is
Lisp_Int.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Thu, 17 Feb 2000 08:16:19 +0000 |
parents | 2e811e86c10b |
children | d401b5066063 |
comparison
equal
deleted
inserted
replaced
27720:c727b02df258 | 27721:c2a9f4621f9a |
---|---|
11991 unsigned char *eol_str; | 11991 unsigned char *eol_str; |
11992 int eol_str_len; | 11992 int eol_str_len; |
11993 /* The EOL conversion we are using. */ | 11993 /* The EOL conversion we are using. */ |
11994 Lisp_Object eoltype; | 11994 Lisp_Object eoltype; |
11995 | 11995 |
11996 val = coding_system; | 11996 val = Fget (coding_system, Qcoding_system); |
11997 | 11997 |
11998 if (NILP (val)) /* Not yet decided. */ | 11998 if (!VECTORP (val)) /* Not yet decided. */ |
11999 { | 11999 { |
12000 if (multibyte) | 12000 if (multibyte) |
12001 *buf++ = '-'; | 12001 *buf++ = '-'; |
12002 if (eol_flag) | 12002 if (eol_flag) |
12003 eoltype = eol_mnemonic_undecided; | 12003 eoltype = eol_mnemonic_undecided; |
12006 else | 12006 else |
12007 { | 12007 { |
12008 Lisp_Object eolvalue; | 12008 Lisp_Object eolvalue; |
12009 | 12009 |
12010 eolvalue = Fget (coding_system, Qeol_type); | 12010 eolvalue = Fget (coding_system, Qeol_type); |
12011 | |
12012 while (!NILP (val) && SYMBOLP (val)) | |
12013 { | |
12014 val = Fget (val, Qcoding_system); | |
12015 if (NILP (eolvalue)) | |
12016 eolvalue = Fget (val, Qeol_type); | |
12017 } | |
12018 | 12011 |
12019 if (multibyte) | 12012 if (multibyte) |
12020 *buf++ = XFASTINT (XVECTOR (val)->contents[1]); | 12013 *buf++ = XFASTINT (XVECTOR (val)->contents[1]); |
12021 | 12014 |
12022 if (eol_flag) | 12015 if (eol_flag) |
12044 eol_str_len = XSTRING (eoltype)->size; | 12037 eol_str_len = XSTRING (eoltype)->size; |
12045 } | 12038 } |
12046 else if (INTEGERP (eoltype) | 12039 else if (INTEGERP (eoltype) |
12047 && CHAR_VALID_P (XINT (eoltype), 0)) | 12040 && CHAR_VALID_P (XINT (eoltype), 0)) |
12048 { | 12041 { |
12042 eol_str = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH); | |
12049 eol_str_len = CHAR_STRING (XINT (eoltype), eol_str); | 12043 eol_str_len = CHAR_STRING (XINT (eoltype), eol_str); |
12050 } | 12044 } |
12051 else | 12045 else |
12052 { | 12046 { |
12053 eol_str = invalid_eol_type; | 12047 eol_str = invalid_eol_type; |