Always print a newline after a matching substitution.

This commit is contained in:
Matt Kraai 2001-05-17 01:02:58 +00:00
parent bfae2529b8
commit 233817437d
2 changed files with 2 additions and 12 deletions

View File

@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line)
break; break;
} }
/* if there's anything left of the line, print it */ puts(hackline);
if (*hackline)
puts(hackline);
/* otherwise, we need to print a newline */
else
printf("\n");
/* cleanup */ /* cleanup */
free(regmatch); free(regmatch);

7
sed.c
View File

@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line)
break; break;
} }
/* if there's anything left of the line, print it */ puts(hackline);
if (*hackline)
puts(hackline);
/* otherwise, we need to print a newline */
else
printf("\n");
/* cleanup */ /* cleanup */
free(regmatch); free(regmatch);