aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2000-09-07 13:01:44 +0000
committerKenichi Handa2000-09-07 13:01:44 +0000
commitfd6f711b51c82dc0d72c9288af5e3f5bab841979 (patch)
treefc47ede5196554cc08d52260f16536ea22b5fac6 /src/coding.c
parentfc53a2147a655cb0bef79fcdd76e4df6414c8ded (diff)
downloademacs-fd6f711b51c82dc0d72c9288af5e3f5bab841979.tar.gz
emacs-fd6f711b51c82dc0d72c9288af5e3f5bab841979.zip
(detect_coding_sjis): Check the byte sequence more regidly.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index 366cf6647a7..fa079a749cb 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2266,10 +2266,15 @@ detect_coding_sjis (src, src_end)
2266 while (1) 2266 while (1)
2267 { 2267 {
2268 ONE_MORE_BYTE (c); 2268 ONE_MORE_BYTE (c);
2269 if ((c >= 0x80 && c < 0xA0) || c >= 0xE0) 2269 if (c >= 0x81)
2270 { 2270 {
2271 ONE_MORE_BYTE (c); 2271 if (c <= 0x9F || (c >= 0xE0 && c <= 0xEF))
2272 if (c < 0x40) 2272 {
2273 ONE_MORE_BYTE (c);
2274 if (c < 0x40 || c == 0x7F || c > 0xFC)
2275 return 0;
2276 }
2277 else if (c > 0xDF)
2273 return 0; 2278 return 0;
2274 } 2279 }
2275 } 2280 }