diff options
author | Mark Whitley <markw@lineo.com> | 2001-03-26 16:47:57 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-03-26 16:47:57 +0000 |
commit | af633757d3a7c2830851446278161618141f2e54 (patch) | |
tree | 3682ab34bf3dd8351fa27e55e9ed3385b8bc6849 | |
parent | 049dc25fe77b1225d50460800b911d765f120e85 (diff) | |
download | busybox-w32-af633757d3a7c2830851446278161618141f2e54.tar.gz busybox-w32-af633757d3a7c2830851446278161618141f2e54.tar.bz2 busybox-w32-af633757d3a7c2830851446278161618141f2e54.zip |
Applied patch from Anthony Towns that he posted to Debian bug tracking.
-rw-r--r-- | editors/sed.c | 5 | ||||
-rw-r--r-- | sed.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/editors/sed.c b/editors/sed.c index a18f6e522..897c290d5 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -622,9 +622,10 @@ static void process_file(FILE *file) | |||
622 | if (sed_cmds[i].beg_match && sed_cmds[i].end_match) { | 622 | if (sed_cmds[i].beg_match && sed_cmds[i].end_match) { |
623 | if (still_in_range || regexec(sed_cmds[i].beg_match, line, 0, NULL, 0) == 0) { | 623 | if (still_in_range || regexec(sed_cmds[i].beg_match, line, 0, NULL, 0) == 0) { |
624 | line_altered += do_sed_command(&sed_cmds[i], line); | 624 | line_altered += do_sed_command(&sed_cmds[i], line); |
625 | still_in_range = 1; | 625 | if (still_in_range && regexec(sed_cmds[i].end_match, line, 0, NULL, 0) == 0) |
626 | if (regexec(sed_cmds[i].end_match, line, 0, NULL, 0) == 0) | ||
627 | still_in_range = 0; | 626 | still_in_range = 0; |
627 | else | ||
628 | still_in_range = 1; | ||
628 | } | 629 | } |
629 | } | 630 | } |
630 | 631 | ||
@@ -622,9 +622,10 @@ static void process_file(FILE *file) | |||
622 | if (sed_cmds[i].beg_match && sed_cmds[i].end_match) { | 622 | if (sed_cmds[i].beg_match && sed_cmds[i].end_match) { |
623 | if (still_in_range || regexec(sed_cmds[i].beg_match, line, 0, NULL, 0) == 0) { | 623 | if (still_in_range || regexec(sed_cmds[i].beg_match, line, 0, NULL, 0) == 0) { |
624 | line_altered += do_sed_command(&sed_cmds[i], line); | 624 | line_altered += do_sed_command(&sed_cmds[i], line); |
625 | still_in_range = 1; | 625 | if (still_in_range && regexec(sed_cmds[i].end_match, line, 0, NULL, 0) == 0) |
626 | if (regexec(sed_cmds[i].end_match, line, 0, NULL, 0) == 0) | ||
627 | still_in_range = 0; | 626 | still_in_range = 0; |
627 | else | ||
628 | still_in_range = 1; | ||
628 | } | 629 | } |
629 | } | 630 | } |
630 | 631 | ||