aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-05-14 19:53:08 +0000
committerMark Whitley <markw@lineo.com>2001-05-14 19:53:08 +0000
commitdd527d3c6215dba1ad7ddcdd6f393b9fff6dddef (patch)
treebb25a95d1ebdfb6fe487caa51153f1fdf7316509
parent9de265926498000ae7adc016a25e3af0d249db79 (diff)
downloadbusybox-w32-dd527d3c6215dba1ad7ddcdd6f393b9fff6dddef.tar.gz
busybox-w32-dd527d3c6215dba1ad7ddcdd6f393b9fff6dddef.tar.bz2
busybox-w32-dd527d3c6215dba1ad7ddcdd6f393b9fff6dddef.zip
...And now that we're chomping lines, we need to re-add the newline later...
-rw-r--r--editors/sed.c6
-rw-r--r--sed.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 7fd803fdb..21614fc77 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -637,7 +637,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line)
637 break; 637 break;
638 638
639 case 'a': 639 case 'a':
640 fputs(line, stdout); 640 puts(line);
641 fputs(sed_cmd->editline, stdout); 641 fputs(sed_cmd->editline, stdout);
642 altered++; 642 altered++;
643 break; 643 break;
@@ -653,7 +653,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line)
653 653
654 case 'r': { 654 case 'r': {
655 FILE *file; 655 FILE *file;
656 fputs(line, stdout); 656 puts(line);
657 file = fopen(sed_cmd->filename, "r"); 657 file = fopen(sed_cmd->filename, "r");
658 if (file) 658 if (file)
659 print_file(file); 659 print_file(file);
@@ -724,7 +724,7 @@ static void process_file(FILE *file)
724 * line was altered (via a 'd'elete or 's'ubstitution), in which case 724 * line was altered (via a 'd'elete or 's'ubstitution), in which case
725 * the altered line was already printed */ 725 * the altered line was already printed */
726 if (!be_quiet && !line_altered) 726 if (!be_quiet && !line_altered)
727 fputs(line, stdout); 727 puts(line);
728 728
729 free(line); 729 free(line);
730 } 730 }
diff --git a/sed.c b/sed.c
index 7fd803fdb..21614fc77 100644
--- a/sed.c
+++ b/sed.c
@@ -637,7 +637,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line)
637 break; 637 break;
638 638
639 case 'a': 639 case 'a':
640 fputs(line, stdout); 640 puts(line);
641 fputs(sed_cmd->editline, stdout); 641 fputs(sed_cmd->editline, stdout);
642 altered++; 642 altered++;
643 break; 643 break;
@@ -653,7 +653,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line)
653 653
654 case 'r': { 654 case 'r': {
655 FILE *file; 655 FILE *file;
656 fputs(line, stdout); 656 puts(line);
657 file = fopen(sed_cmd->filename, "r"); 657 file = fopen(sed_cmd->filename, "r");
658 if (file) 658 if (file)
659 print_file(file); 659 print_file(file);
@@ -724,7 +724,7 @@ static void process_file(FILE *file)
724 * line was altered (via a 'd'elete or 's'ubstitution), in which case 724 * line was altered (via a 'd'elete or 's'ubstitution), in which case
725 * the altered line was already printed */ 725 * the altered line was already printed */
726 if (!be_quiet && !line_altered) 726 if (!be_quiet && !line_altered)
727 fputs(line, stdout); 727 puts(line);
728 728
729 free(line); 729 free(line);
730 } 730 }