Always print a newline after a matching substitution.
This commit is contained in:
parent
bfae2529b8
commit
233817437d
@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line)
|
||||
break;
|
||||
}
|
||||
|
||||
/* if there's anything left of the line, print it */
|
||||
if (*hackline)
|
||||
puts(hackline);
|
||||
/* otherwise, we need to print a newline */
|
||||
else
|
||||
printf("\n");
|
||||
puts(hackline);
|
||||
|
||||
/* cleanup */
|
||||
free(regmatch);
|
||||
|
7
sed.c
7
sed.c
@ -577,12 +577,7 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, const char *line)
|
||||
break;
|
||||
}
|
||||
|
||||
/* if there's anything left of the line, print it */
|
||||
if (*hackline)
|
||||
puts(hackline);
|
||||
/* otherwise, we need to print a newline */
|
||||
else
|
||||
printf("\n");
|
||||
puts(hackline);
|
||||
|
||||
/* cleanup */
|
||||
free(regmatch);
|
||||
|
Loading…
Reference in New Issue
Block a user