diff options
| author | Kenichi Handa | 2008-12-03 02:27:26 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-12-03 02:27:26 +0000 |
| commit | 4533845dc4df54eb9b817b17758f437c801f4d48 (patch) | |
| tree | 17734a5a05ca20eef9eed424fcb1ba492a24273a /src/coding.c | |
| parent | 453b38f050e3e87b14218df175bdd1d71740fc41 (diff) | |
| download | emacs-4533845dc4df54eb9b817b17758f437c801f4d48.tar.gz emacs-4533845dc4df54eb9b817b17758f437c801f4d48.zip | |
(detect_coding_system): Initialize utf_16_le_eol to -1, val to
Qnil.
(produce_chars): Initialize consumed_chars to 0.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c index 88678a00767..acdb92214c2 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -6330,7 +6330,7 @@ produce_chars (coding, translation_table, last_block) | |||
| 6330 | if (coding->src_multibyte) | 6330 | if (coding->src_multibyte) |
| 6331 | { | 6331 | { |
| 6332 | int multibytep = 1; | 6332 | int multibytep = 1; |
| 6333 | EMACS_INT consumed_chars; | 6333 | EMACS_INT consumed_chars = 0; |
| 6334 | 6334 | ||
| 6335 | while (1) | 6335 | while (1) |
| 6336 | { | 6336 | { |
| @@ -7690,7 +7690,7 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep, | |||
| 7690 | { | 7690 | { |
| 7691 | const unsigned char *src_end = src + src_bytes; | 7691 | const unsigned char *src_end = src + src_bytes; |
| 7692 | Lisp_Object attrs, eol_type; | 7692 | Lisp_Object attrs, eol_type; |
| 7693 | Lisp_Object val; | 7693 | Lisp_Object val = Qnil; |
| 7694 | struct coding_system coding; | 7694 | struct coding_system coding; |
| 7695 | int id; | 7695 | int id; |
| 7696 | struct coding_detection_info detect_info; | 7696 | struct coding_detection_info detect_info; |
| @@ -7855,7 +7855,6 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep, | |||
| 7855 | { | 7855 | { |
| 7856 | int mask = detect_info.rejected | detect_info.found; | 7856 | int mask = detect_info.rejected | detect_info.found; |
| 7857 | int found = 0; | 7857 | int found = 0; |
| 7858 | val = Qnil; | ||
| 7859 | 7858 | ||
| 7860 | for (i = coding_category_raw_text - 1; i >= 0; i--) | 7859 | for (i = coding_category_raw_text - 1; i >= 0; i--) |
| 7861 | { | 7860 | { |
| @@ -7918,7 +7917,7 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep, | |||
| 7918 | 7917 | ||
| 7919 | /* Then, detect eol-format if necessary. */ | 7918 | /* Then, detect eol-format if necessary. */ |
| 7920 | { | 7919 | { |
| 7921 | int normal_eol = -1, utf_16_be_eol = -1, utf_16_le_eol; | 7920 | int normal_eol = -1, utf_16_be_eol = -1, utf_16_le_eol = -1; |
| 7922 | Lisp_Object tail; | 7921 | Lisp_Object tail; |
| 7923 | 7922 | ||
| 7924 | if (VECTORP (eol_type)) | 7923 | if (VECTORP (eol_type)) |
| @@ -7984,7 +7983,7 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep, | |||
| 7984 | } | 7983 | } |
| 7985 | } | 7984 | } |
| 7986 | 7985 | ||
| 7987 | return (highest ? XCAR (val) : val); | 7986 | return (highest ? (CONSP (val) ? XCAR (val) : Qnil) : val); |
| 7988 | } | 7987 | } |
| 7989 | 7988 | ||
| 7990 | 7989 | ||