emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/coding.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/coding.c,v
Date: Fri, 11 Jan 2008 11:28:45 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/01/11 11:28:45

Index: coding.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/coding.c,v
retrieving revision 1.361
retrieving revision 1.362
diff -u -b -r1.361 -r1.362
--- coding.c    9 Jan 2008 06:05:23 -0000       1.361
+++ coding.c    11 Jan 2008 11:28:45 -0000      1.362
@@ -4153,12 +4153,16 @@
 
  label_loop_detect_coding:
   null_byte_found = 0;
-  while (src < src_end && ascii_skip_code[*src])
+  /* We stop this loop before the last byte because it may be a NULL
+     anchor byte.  */
+  while (src < src_end - 1 && ascii_skip_code[*src])
     null_byte_found |= (! *src++);
-  if (! null_byte_found)
+  if (ascii_skip_code[*src])
+    src++;
+  else if (! null_byte_found)
     {
       unsigned char *p = src + 1;
-      while (p < src_end)
+      while (p < src_end - 1)
        null_byte_found |= (! *p++);
     }
   *skip = src - source;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]