]> git.eshelyaron.com Git - emacs.git/commitdiff
(to_multibyte): Ensure read_buffer is at least twice
authorGerd Moellmann <gerd@gnu.org>
Tue, 30 Oct 2001 16:35:42 +0000 (16:35 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 30 Oct 2001 16:35:42 +0000 (16:35 +0000)
as large as the number of bytes to convert.

src/ChangeLog
src/lread.c

index 0eb9c31220d4f4f04e299bf2c40e8e257879abd4..db1539af6f2a76ecc03b0b922c5f35aa2e3bad27 100644 (file)
@@ -1,5 +1,8 @@
 2001-10-30  Gerd Moellmann  <gerd@gnu.org>
 
+       * lread.c (to_multibyte): Ensure read_buffer is at least twice
+       as large as the number of bytes to convert.
+       
        * lread.c (to_multibyte): New function.
        (read1): Use it.
 
index 59e84105a393b88b5fe3d5e29adf377b4ebdab9b..072de3a98ec2a9c201f8efaf93b4808deac1267d 100644 (file)
@@ -1790,7 +1790,7 @@ to_multibyte (p, end, nchars)
   int nbytes;
 
   parse_str_as_multibyte (read_buffer, *p - read_buffer, &nbytes, nchars);
-  if (nbytes > read_buffer_size)
+  if (read_buffer_size < 2 * nbytes)
     {
       int offset = *p - read_buffer;
       read_buffer_size *= 2;
@@ -2239,6 +2239,9 @@ read1 (readcharfun, pch, first_in_list)
        if (c < 0)
          end_of_file_error ();
 
+       if (p - read_buffer == 24183)
+         fprintf (stderr, "hello\n");
+
        /* If purifying, and string starts with \ newline,
           return zero instead.  This is for doc strings
           that we are really going to find in etc/DOC.nn.nn  */