mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-18 09:55:42 +00:00
(detect_coding_mask): Check also coding-category-binary.
This commit is contained in:
parent
828fac3a67
commit
5ab13dd02e
1 changed files with 9 additions and 6 deletions
15
src/coding.c
15
src/coding.c
|
@ -3256,15 +3256,18 @@ detect_coding_mask (source, src_bytes, priorities, skip)
|
|||
{
|
||||
for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)
|
||||
{
|
||||
priorities[i] &= try;
|
||||
if (priorities[i] & CODING_CATEGORY_MASK_ISO)
|
||||
if (priorities[i] & try & CODING_CATEGORY_MASK_ISO)
|
||||
mask = detect_coding_iso2022 (src, src_end);
|
||||
else if (priorities[i] & CODING_CATEGORY_MASK_SJIS)
|
||||
else if (priorities[i] & try & CODING_CATEGORY_MASK_SJIS)
|
||||
mask = detect_coding_sjis (src, src_end);
|
||||
else if (priorities[i] & CODING_CATEGORY_MASK_BIG5)
|
||||
else if (priorities[i] & try & CODING_CATEGORY_MASK_BIG5)
|
||||
mask = detect_coding_big5 (src, src_end);
|
||||
else if (priorities[i] & CODING_CATEGORY_MASK_EMACS_MULE)
|
||||
else if (priorities[i] & try & CODING_CATEGORY_MASK_EMACS_MULE)
|
||||
mask = detect_coding_emacs_mule (src, src_end);
|
||||
else if (priorities[i] & CODING_CATEGORY_MASK_RAW_TEXT)
|
||||
mask = CODING_CATEGORY_MASK_RAW_TEXT;
|
||||
else if (priorities[i] & CODING_CATEGORY_MASK_BINARY)
|
||||
mask = CODING_CATEGORY_MASK_BINARY;
|
||||
if (mask)
|
||||
goto label_return_highest_only;
|
||||
}
|
||||
|
@ -3279,7 +3282,7 @@ detect_coding_mask (source, src_bytes, priorities, skip)
|
|||
if (try & CODING_CATEGORY_MASK_EMACS_MULE)
|
||||
mask |= detect_coding_emacs_mule (src, src_end);
|
||||
}
|
||||
return (mask | CODING_CATEGORY_MASK_RAW_TEXT);
|
||||
return (mask | CODING_CATEGORY_MASK_RAW_TEXT | CODING_CATEGORY_MASK_BINARY);
|
||||
|
||||
label_return_highest_only:
|
||||
for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue