Skip to content

Commit

Permalink
Backport sed 's/$/@/' bugfix, thanks to Matt Kraai
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBAndersen committed Oct 24, 2001
1 parent ce99805 commit eb2a21f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions busybox/editors/sed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions busybox/sed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit eb2a21f

Please sign in to comment.