From 020c84db3d926d727ff355e3930f338dd124061d Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 15 Jul 2022 23:42:23 +0200 Subject: [PATCH] Try forcing ed to produce LF output files rather than CRLF ones. --- lang/m2/comp/build.lua | 1 - util/cmisc/ed.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lang/m2/comp/build.lua b/lang/m2/comp/build.lua index 0bb27c5d1..1de3a4348 100644 --- a/lang/m2/comp/build.lua +++ b/lang/m2/comp/build.lua @@ -52,7 +52,6 @@ for _, f in ipairs(filenamesof(xh_files)) do outleaves = { name..".h" }, commands = { "%{ins[1]} < %{ins[2]} > %{outs}", - "cat %{outs}", } } end diff --git a/util/cmisc/ed.c b/util/cmisc/ed.c index c916aa962..e88ef0ec4 100644 --- a/util/cmisc/ed.c +++ b/util/cmisc/ed.c @@ -981,7 +981,7 @@ char *fname; nonascii = nullchar = truncated = 0; if (diag) printf("\"%s\" ", fname); - if ((fp = fopen(fname, "r")) == NULL) { + if ((fp = fopen(fname, "rb")) == NULL) { printf("file open err\n"); return(ERR); } @@ -1028,7 +1028,7 @@ int apflg; lines = bytes = 0; if (diag) printf("\"%s\" ", fname); - if ((fp = fopen(fname, (apflg ? "a" : "w"))) == NULL) { + if ((fp = fopen(fname, (apflg ? "ab" : "wb"))) == NULL) { printf("file open error\n"); return(ERR); }