diff options
author | Matt Kraai <kraai@debian.org> | 2001-07-30 14:05:58 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-07-30 14:05:58 +0000 |
commit | 547e10208224a60c513f3d127ea1d0e2a4e23f19 (patch) | |
tree | 3b18941fabf02df9b3b07a905f3ea638fce36c2b | |
parent | 7499918f304554c6a0047e43b679cc481cc70eba (diff) | |
download | busybox-w32-547e10208224a60c513f3d127ea1d0e2a4e23f19.tar.gz busybox-w32-547e10208224a60c513f3d127ea1d0e2a4e23f19.tar.bz2 busybox-w32-547e10208224a60c513f3d127ea1d0e2a4e23f19.zip |
Preserve whether or not the line was previously altered when running a
subst command (discovery and patch by Jim Gleason).
-rw-r--r-- | editors/sed.c | 4 | ||||
-rw-r--r-- | sed.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/editors/sed.c b/editors/sed.c index 24b62e5fa..a18cfc7c3 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -650,12 +650,12 @@ static void process_file(FILE *file) | |||
650 | 650 | ||
651 | /* we print the line once, unless we were told to be quiet */ | 651 | /* we print the line once, unless we were told to be quiet */ |
652 | if (!be_quiet) | 652 | if (!be_quiet) |
653 | altered = do_subst_command(&sed_cmds[i], line); | 653 | altered |= do_subst_command(&sed_cmds[i], line); |
654 | 654 | ||
655 | /* we also print the line if we were given the 'p' flag | 655 | /* we also print the line if we were given the 'p' flag |
656 | * (this is quite possibly the second printing) */ | 656 | * (this is quite possibly the second printing) */ |
657 | if (sed_cmds[i].sub_p) | 657 | if (sed_cmds[i].sub_p) |
658 | altered = do_subst_command(&sed_cmds[i], line); | 658 | altered |= do_subst_command(&sed_cmds[i], line); |
659 | 659 | ||
660 | break; | 660 | break; |
661 | 661 | ||
@@ -650,12 +650,12 @@ static void process_file(FILE *file) | |||
650 | 650 | ||
651 | /* we print the line once, unless we were told to be quiet */ | 651 | /* we print the line once, unless we were told to be quiet */ |
652 | if (!be_quiet) | 652 | if (!be_quiet) |
653 | altered = do_subst_command(&sed_cmds[i], line); | 653 | altered |= do_subst_command(&sed_cmds[i], line); |
654 | 654 | ||
655 | /* we also print the line if we were given the 'p' flag | 655 | /* we also print the line if we were given the 'p' flag |
656 | * (this is quite possibly the second printing) */ | 656 | * (this is quite possibly the second printing) */ |
657 | if (sed_cmds[i].sub_p) | 657 | if (sed_cmds[i].sub_p) |
658 | altered = do_subst_command(&sed_cmds[i], line); | 658 | altered |= do_subst_command(&sed_cmds[i], line); |
659 | 659 | ||
660 | break; | 660 | break; |
661 | 661 | ||