From 9e63b4a53403840acf3d759d8ac16475c12562e2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 28 Apr 2013 21:21:01 +0300 Subject: [PATCH] Fix bug #14287 with decoding EOL by *-dos coding systems. src/coding.c (decode_coding_gap): Don't remove the character before a newline unless it's a CR character. --- src/ChangeLog | 5 +++++ src/coding.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5fa2404a243..2e9e19fd547 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-04-28 Eli Zaretskii + + * 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 * dispextern.h (struct face): Move enum face_underline_type diff --git a/src/coding.c b/src/coding.c index b9fb92c481b..f6664e179b7 100644 --- a/src/coding.c +++ b/src/coding.c @@ -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; -- 2.39.2