summaryrefslogtreecommitdiff
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-12-03 02:27:26 +0000
committerKenichi Handa <handa@m17n.org>2008-12-03 02:27:26 +0000
commit4533845dc4df54eb9b817b17758f437c801f4d48 (patch)
tree17734a5a05ca20eef9eed424fcb1ba492a24273a /src/coding.c
parent453b38f050e3e87b14218df175bdd1d71740fc41 (diff)
downloademacs-4533845dc4df54eb9b817b17758f437c801f4d48.tar.gz
(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.c9
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)
if (coding->src_multibyte)
{
int multibytep = 1;
- EMACS_INT consumed_chars;
+ EMACS_INT consumed_chars = 0;
while (1)
{
@@ -7690,7 +7690,7 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
{
const unsigned char *src_end = src + src_bytes;
Lisp_Object attrs, eol_type;
- Lisp_Object val;
+ Lisp_Object val = Qnil;
struct coding_system coding;
int id;
struct coding_detection_info detect_info;
@@ -7855,7 +7855,6 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
{
int mask = detect_info.rejected | detect_info.found;
int found = 0;
- val = Qnil;
for (i = coding_category_raw_text - 1; i >= 0; i--)
{
@@ -7918,7 +7917,7 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
/* Then, detect eol-format if necessary. */
{
- int normal_eol = -1, utf_16_be_eol = -1, utf_16_le_eol;
+ int normal_eol = -1, utf_16_be_eol = -1, utf_16_le_eol = -1;
Lisp_Object tail;
if (VECTORP (eol_type))
@@ -7984,7 +7983,7 @@ detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
}
}
- return (highest ? XCAR (val) : val);
+ return (highest ? (CONSP (val) ? XCAR (val) : Qnil) : val);
}