summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-05-26 14:41:45 -0400
committerPaul Smith <psmith@gnu.org>2013-05-26 14:41:45 -0400
commit74d4cf5630f7028e2a615b8ff140f0b6e6d95ae1 (patch)
treef787d5b91d5ef0c3db9653d551bd55bfa4b8c22e /read.c
parent54ce9982f952a9c8f2a9a0935edaff51f962d339 (diff)
downloadmake-74d4cf5630f7028e2a615b8ff140f0b6e6d95ae1.tar.gz
[SV #38945] Copy the entire buffer back when overwriting CR
Diffstat (limited to 'read.c')
-rw-r--r--read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read.c b/read.c
index 36d3a8fa..d6e6fcb1 100644
--- a/read.c
+++ b/read.c
@@ -2542,7 +2542,7 @@ readline (struct ebuffer *ebuf)
if ((p - start) > 1 && p[-2] == '\r')
{
--p;
- p[-1] = '\n';
+ memmove (p-1, p, strlen (p) + 1);
}
#endif