...Need to print just a few more newlines.

This commit is contained in:
Mark Whitley 2001-05-14 20:44:26 +00:00
parent 2416dfc3c9
commit d928accbbd
2 changed files with 10 additions and 4 deletions

View File

@ -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 there's anything left of the line, print it */
if (*hackline) if (*hackline)
fputs(hackline, stdout); puts(hackline);
/* otherwise, we need to print a newline */
else
printf("\n");
/* cleanup */ /* cleanup */
free(regmatch); free(regmatch);
@ -594,7 +597,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line)
switch (sed_cmd->cmd) { switch (sed_cmd->cmd) {
case 'p': case 'p':
fputs(line, stdout); puts(line);
break; break;
case 'd': case 'd':

7
sed.c
View File

@ -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 there's anything left of the line, print it */
if (*hackline) if (*hackline)
fputs(hackline, stdout); puts(hackline);
/* otherwise, we need to print a newline */
else
printf("\n");
/* cleanup */ /* cleanup */
free(regmatch); free(regmatch);
@ -594,7 +597,7 @@ static int do_sed_command(const struct sed_cmd *sed_cmd, const char *line)
switch (sed_cmd->cmd) { switch (sed_cmd->cmd) {
case 'p': case 'p':
fputs(line, stdout); puts(line);
break; break;
case 'd': case 'd':