mirror of
https://git.busybox.net/busybox.git
synced 2024-11-27 23:53:29 +08:00
Fix empty line substitutions (noted by Joshua Hudson).
This commit is contained in:
parent
6ccdd8c122
commit
8470b9a85c
@ -589,8 +589,8 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, char **line)
|
||||
|
||||
/* and now, as long as we've got a line to try matching and if we can match
|
||||
* the search string, we make substitutions */
|
||||
while (*hackline && (regexec(sed_cmd->sub_match, hackline,
|
||||
sed_cmd->num_backrefs+1, regmatch, 0) == 0) ) {
|
||||
while ((*hackline || !altered) && (regexec(sed_cmd->sub_match, hackline,
|
||||
sed_cmd->num_backrefs+1, regmatch, 0) != REG_NOMATCH) ) {
|
||||
int i;
|
||||
|
||||
/* print everything before the match */
|
||||
|
4
sed.c
4
sed.c
@ -589,8 +589,8 @@ static int do_subst_command(const struct sed_cmd *sed_cmd, char **line)
|
||||
|
||||
/* and now, as long as we've got a line to try matching and if we can match
|
||||
* the search string, we make substitutions */
|
||||
while (*hackline && (regexec(sed_cmd->sub_match, hackline,
|
||||
sed_cmd->num_backrefs+1, regmatch, 0) == 0) ) {
|
||||
while ((*hackline || !altered) && (regexec(sed_cmd->sub_match, hackline,
|
||||
sed_cmd->num_backrefs+1, regmatch, 0) != REG_NOMATCH) ) {
|
||||
int i;
|
||||
|
||||
/* print everything before the match */
|
||||
|
Loading…
Reference in New Issue
Block a user