Fix bug #14287 with decoding EOL by *-dos coding systems.
authorEli Zaretskii <eliz@gnu.org>
Sun, 28 Apr 2013 18:21:01 +0000 (21:21 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 28 Apr 2013 18:21:01 +0000 (21:21 +0300)
 src/coding.c (decode_coding_gap): Don't remove the character before
 a newline unless it's a CR character.

src/ChangeLog
src/coding.c

index 5fa2404..2e9e19f 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-28  Eli Zaretskii  <eliz@gnu.org>
+
+       * coding.c (decode_coding_gap): Don't remove the character before
+       a newline unless it's a CR character.  (Bug#14287)
+
 2013-04-28  Dan Nicolaescu  <dann@gnu.org>
 
        * dispextern.h (struct face): Move enum face_underline_type
index b9fb92c..f6664e1 100644 (file)
@@ -7774,7 +7774,7 @@ decode_coding_gap (struct coding_system *coding,
              while (src_beg < src)
                {
                  *--dst = *--src;
-                 if (*src == '\n')
+                 if (*src == '\n' && src > src_beg && src[-1] == '\r')
                    src--;
                }
              diff = dst - src;