Mercurial > emacs
comparison src/coding.c @ 22009:8a2d45cadd66
(detect_coding_mask): Check also coding-category-binary.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Sat, 09 May 1998 21:47:17 +0000 |
| parents | e9014d2166a4 |
| children | e144ad749084 |
comparison
equal
deleted
inserted
replaced
| 22008:6182deb2d814 | 22009:8a2d45cadd66 |
|---|---|
| 3254 mask = 0; | 3254 mask = 0; |
| 3255 if (priorities) | 3255 if (priorities) |
| 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 } |
| 3271 return CODING_CATEGORY_MASK_RAW_TEXT; | 3274 return CODING_CATEGORY_MASK_RAW_TEXT; |
| 3272 } | 3275 } |
| 3277 if (try & CODING_CATEGORY_MASK_BIG5) | 3280 if (try & CODING_CATEGORY_MASK_BIG5) |
| 3278 mask |= detect_coding_big5 (src, src_end); | 3281 mask |= detect_coding_big5 (src, src_end); |
| 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++) |
| 3286 { | 3289 { |
| 3287 if (mask & priorities[i]) | 3290 if (mask & priorities[i]) |
