commit f52bd35eb9f0aeccfe3d00a1ceefe64dca087fcc
parent a666c0f736069129c42e9235a2758406aea969f6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 3 Dec 2015 12:25:15 +0100
Fix dowrite()
Lines already have the newline, so don't add it
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ed.c b/ed.c
@@ -432,10 +432,8 @@ dowrite(char *fname, int trunc)
if (!(fp = fopen(fname, (trunc) ? "w" : "a")))
error("input/output error");
- for (i = line1; i <= line2; ++i) {
- s = gettxt(i);
- fprintf(fp, "%s\n", s);
- }
+ for (i = line1; i <= line2; ++i)
+ fputs(gettxt(i), fp);
curln = line2;
if (fclose(fp))