...And now that we're chomping lines, we need to re-add the newline later...
diff --git a/editors/sed.c b/editors/sed.c
index 7fd803f..21614fc 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -637,7 +637,7 @@
break;
case 'a':
- fputs(line, stdout);
+ puts(line);
fputs(sed_cmd->editline, stdout);
altered++;
break;
@@ -653,7 +653,7 @@
case 'r': {
FILE *file;
- fputs(line, stdout);
+ puts(line);
file = fopen(sed_cmd->filename, "r");
if (file)
print_file(file);
@@ -724,7 +724,7 @@
* line was altered (via a 'd'elete or 's'ubstitution), in which case
* the altered line was already printed */
if (!be_quiet && !line_altered)
- fputs(line, stdout);
+ puts(line);
free(line);
}