summaryrefslogtreecommitdiff
path: root/editors/sed.c
diff options
context:
space:
mode:
authorMatt Kraai2001-07-30 14:05:58 +0000
committerMatt Kraai2001-07-30 14:05:58 +0000
commit547e10208224a60c513f3d127ea1d0e2a4e23f19 (patch)
tree3b18941fabf02df9b3b07a905f3ea638fce36c2b /editors/sed.c
parent7499918f304554c6a0047e43b679cc481cc70eba (diff)
downloadbusybox-547e10208224a60c513f3d127ea1d0e2a4e23f19.zip
busybox-547e10208224a60c513f3d127ea1d0e2a4e23f19.tar.gz
Preserve whether or not the line was previously altered when running a
subst command (discovery and patch by Jim Gleason).
Diffstat (limited to 'editors/sed.c')
-rw-r--r--editors/sed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/sed.c b/editors/sed.c
index 24b62e5..a18cfc7 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -650,12 +650,12 @@ static void process_file(FILE *file)
/* we print the line once, unless we were told to be quiet */
if (!be_quiet)
- altered = do_subst_command(&sed_cmds[i], line);
+ altered |= do_subst_command(&sed_cmds[i], line);
/* we also print the line if we were given the 'p' flag
* (this is quite possibly the second printing) */
if (sed_cmds[i].sub_p)
- altered = do_subst_command(&sed_cmds[i], line);
+ altered |= do_subst_command(&sed_cmds[i], line);
break;