aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2008-01-11 11:30:25 +0000
committerKenichi Handa2008-01-11 11:30:25 +0000
commit81cd7687abd636f4c9b4cc380909ab6a69b88d74 (patch)
treed9eeee07334fd6d7411fd70e69a1d0feba9b1799 /src/coding.c
parent6671cab318609084ef86f02878da836107ceaee8 (diff)
downloademacs-81cd7687abd636f4c9b4cc380909ab6a69b88d74.tar.gz
emacs-81cd7687abd636f4c9b4cc380909ab6a69b88d74.zip
(detect_coding_mask): Fix previous change.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index 4e4147370cb..dda3f0f854c 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4153,12 +4153,16 @@ detect_coding_mask (source, src_bytes, priorities, skip, multibytep)
4153 4153
4154 label_loop_detect_coding: 4154 label_loop_detect_coding:
4155 null_byte_found = 0; 4155 null_byte_found = 0;
4156 while (src < src_end && ascii_skip_code[*src]) 4156 /* We stop this loop before the last byte because it may be a NULL
4157 anchor byte. */
4158 while (src < src_end - 1 && ascii_skip_code[*src])
4157 null_byte_found |= (! *src++); 4159 null_byte_found |= (! *src++);
4158 if (! null_byte_found) 4160 if (ascii_skip_code[*src])
4161 src++;
4162 else if (! null_byte_found)
4159 { 4163 {
4160 unsigned char *p = src + 1; 4164 unsigned char *p = src + 1;
4161 while (p < src_end) 4165 while (p < src_end - 1)
4162 null_byte_found |= (! *p++); 4166 null_byte_found |= (! *p++);
4163 } 4167 }
4164 *skip = src - source; 4168 *skip = src - source;