HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(detect_coding_utf_16): Fix previous change.
[bpt/emacs.git]
/
src
/
coding.c
diff --git
a/src/coding.c
b/src/coding.c
index
23690bc
..
cde56d9
100644
(file)
--- a/
src/coding.c
+++ b/
src/coding.c
@@
-1665,10
+1665,11
@@
detect_coding_utf_16 (coding, detect_info)
e[c1] = 1;
o[c2] = 1;
e[c1] = 1;
o[c2] = 1;
- detect_info->rejected
- |= (CATEGORY_MASK_UTF_16_BE | CATEGORY_MASK_UTF_16_LE);
+ detect_info->rejected |= (CATEGORY_MASK_UTF_16_AUTO
+ |CATEGORY_MASK_UTF_16_BE
+ | CATEGORY_MASK_UTF_16_LE);
- while (
1
)
+ while (
detect_info->rejected != CATEGORY_MASK_UTF_16
)
{
TWO_MORE_BYTES (c1, c2);
if (c2 < 0)
{
TWO_MORE_BYTES (c1, c2);
if (c2 < 0)
@@
-1678,17
+1679,16
@@
detect_coding_utf_16 (coding, detect_info)
e[c1] = 1;
e_num++;
if (e_num >= 128)
e[c1] = 1;
e_num++;
if (e_num >= 128)
-
break
;
+
detect_info->rejected |= CATEGORY_MASK_UTF_16_BE_NOSIG
;
}
if (! o[c2])
{
}
if (! o[c2])
{
- o[c
1
] = 1;
+ o[c
2
] = 1;
o_num++;
if (o_num >= 128)
o_num++;
if (o_num >= 128)
-
break
;
+
detect_info->rejected |= CATEGORY_MASK_UTF_16_LE_NOSIG
;
}
}
}
}
- detect_info->rejected |= CATEGORY_MASK_UTF_16;
return 0;
}
return 0;
}
@@
-6623,6
+6623,12
@@
get_translation_table (attrs, encodep, max_lookup)
Lisp_Object standard, translation_table;
Lisp_Object val;
Lisp_Object standard, translation_table;
Lisp_Object val;
+ if (NILP (Venable_character_translation))
+ {
+ if (max_lookup)
+ *max_lookup = 0;
+ return Qnil;
+ }
if (encodep)
translation_table = CODING_ATTR_ENCODE_TBL (attrs),
standard = Vstandard_translation_table_for_encode;
if (encodep)
translation_table = CODING_ATTR_ENCODE_TBL (attrs),
standard = Vstandard_translation_table_for_encode;