emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-25 289d5c6: Fix decoding DOS EOL in a unibyte buffer


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 289d5c6: Fix decoding DOS EOL in a unibyte buffer
Date: Wed, 17 Feb 2016 15:49:38 +0000

branch: emacs-25
commit 289d5c6e976d4ea557b0f71008468d42ee0258ad
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix decoding DOS EOL in a unibyte buffer
    
    * src/coding.c (decode_eol): Loop over bytes, not characters.
    (Bug#5251)
---
 src/coding.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/coding.c b/src/coding.c
index 3bee16c..e591bed 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -6828,11 +6828,11 @@ decode_eol (struct coding_system *coding)
        }
       else
        {
-         ptrdiff_t pos_byte = coding->dst_pos_byte;
          ptrdiff_t pos = coding->dst_pos;
-         ptrdiff_t pos_end = pos + coding->produced_char - 1;
+         ptrdiff_t pos_byte = coding->dst_pos_byte;
+         ptrdiff_t pos_end = pos_byte + coding->produced - 1;
 
-         while (pos < pos_end)
+         while (pos_byte < pos_end)
            {
              p = BYTE_POS_ADDR (pos_byte);
              if (*p == '\r' && p[1] == '\n')



reply via email to

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