diff options
author | Mark Whitley <markw@lineo.com> | 2001-05-14 20:44:26 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-05-14 20:44:26 +0000 |
commit | d928accbbd59732a5d6c536be0adb68b466d603f (patch) | |
tree | 7e00d66b28bb4d32b06601726d91c6a2128fbee8 | |
parent | 2416dfc3c9398aaeb37cf31df667784b8f1fe563 (diff) | |
download | busybox-d928accbbd59732a5d6c536be0adb68b466d603f.tar.gz |
...Need to print just a few more newlines.
-rw-r--r-- | editors/sed.c | 7 | ||||
-rw-r--r-- | sed.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/editors/sed.c b/editors/sed.c index 21614fc77..1c227704e 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -579,7 +579,10 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line) /* if there's anything left of the line, print it */ if (*hackline) - fputs(hackline, stdout); + puts(hackline); + /* otherwise, we need to print a newline */ + else + printf("\n"); /* cleanup */ free(regmatch); @@ -594,7 +597,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line) switch (sed_cmd->cmd) { case 'p': - fputs(line, stdout); + puts(line); break; case 'd': @@ -579,7 +579,10 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line) /* if there's anything left of the line, print it */ if (*hackline) - fputs(hackline, stdout); + puts(hackline); + /* otherwise, we need to print a newline */ + else + printf("\n"); /* cleanup */ free(regmatch); @@ -594,7 +597,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line) switch (sed_cmd->cmd) { case 'p': - fputs(line, stdout); + puts(line); break; case 'd': |