aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-05-09 21:47:17 +0000
committerRichard M. Stallman1998-05-09 21:47:17 +0000
commit5ab13dd02e70b1f8092b8ed82b59e5d477882fe7 (patch)
tree94126cf9172b7891421586141425bbd98f1f22f4 /src
parent828fac3a6708099573f1b4bdbc3fb8b61f1f1ba4 (diff)
downloademacs-5ab13dd02e70b1f8092b8ed82b59e5d477882fe7.tar.gz
emacs-5ab13dd02e70b1f8092b8ed82b59e5d477882fe7.zip
(detect_coding_mask): Check also coding-category-binary.
Diffstat (limited to 'src')
-rw-r--r--src/coding.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/coding.c b/src/coding.c
index fff9292a850..a293d15988a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -3256,15 +3256,18 @@ detect_coding_mask (source, src_bytes, priorities, skip)
3256 { 3256 {
3257 for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++) 3257 for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)
3258 { 3258 {
3259 priorities[i] &= try; 3259 if (priorities[i] & try & CODING_CATEGORY_MASK_ISO)
3260 if (priorities[i] & CODING_CATEGORY_MASK_ISO)
3261 mask = detect_coding_iso2022 (src, src_end); 3260 mask = detect_coding_iso2022 (src, src_end);
3262 else if (priorities[i] & CODING_CATEGORY_MASK_SJIS) 3261 else if (priorities[i] & try & CODING_CATEGORY_MASK_SJIS)
3263 mask = detect_coding_sjis (src, src_end); 3262 mask = detect_coding_sjis (src, src_end);
3264 else if (priorities[i] & CODING_CATEGORY_MASK_BIG5) 3263 else if (priorities[i] & try & CODING_CATEGORY_MASK_BIG5)
3265 mask = detect_coding_big5 (src, src_end); 3264 mask = detect_coding_big5 (src, src_end);
3266 else if (priorities[i] & CODING_CATEGORY_MASK_EMACS_MULE) 3265 else if (priorities[i] & try & CODING_CATEGORY_MASK_EMACS_MULE)
3267 mask = detect_coding_emacs_mule (src, src_end); 3266 mask = detect_coding_emacs_mule (src, src_end);
3267 else if (priorities[i] & CODING_CATEGORY_MASK_RAW_TEXT)
3268 mask = CODING_CATEGORY_MASK_RAW_TEXT;
3269 else if (priorities[i] & CODING_CATEGORY_MASK_BINARY)
3270 mask = CODING_CATEGORY_MASK_BINARY;
3268 if (mask) 3271 if (mask)
3269 goto label_return_highest_only; 3272 goto label_return_highest_only;
3270 } 3273 }
@@ -3279,7 +3282,7 @@ detect_coding_mask (source, src_bytes, priorities, skip)
3279 if (try & CODING_CATEGORY_MASK_EMACS_MULE) 3282 if (try & CODING_CATEGORY_MASK_EMACS_MULE)
3280 mask |= detect_coding_emacs_mule (src, src_end); 3283 mask |= detect_coding_emacs_mule (src, src_end);
3281 } 3284 }
3282 return (mask | CODING_CATEGORY_MASK_RAW_TEXT); 3285 return (mask | CODING_CATEGORY_MASK_RAW_TEXT | CODING_CATEGORY_MASK_BINARY);
3283 3286
3284 label_return_highest_only: 3287 label_return_highest_only:
3285 for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++) 3288 for (i = 0; i < CODING_CATEGORY_IDX_MAX; i++)