aboutsummaryrefslogtreecommitdiff
path: root/sed.c
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-07-30 14:05:58 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-07-30 14:05:58 +0000
commitc16d48a603748882fb17361e8b8c9203595ebbf0 (patch)
tree3b18941fabf02df9b3b07a905f3ea638fce36c2b /sed.c
parent560f787d504c6db2b886538a2a4597f315e64a4c (diff)
downloadbusybox-w32-c16d48a603748882fb17361e8b8c9203595ebbf0.tar.gz
busybox-w32-c16d48a603748882fb17361e8b8c9203595ebbf0.tar.bz2
busybox-w32-c16d48a603748882fb17361e8b8c9203595ebbf0.zip
Preserve whether or not the line was previously altered when running a
subst command (discovery and patch by Jim Gleason). git-svn-id: svn://busybox.net/trunk/busybox@3159 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'sed.c')
-rw-r--r--sed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sed.c b/sed.c
index 24b62e5fa..a18cfc7c3 100644
--- a/sed.c
+++ b/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