From: Matt Kraai Date: Mon, 30 Jul 2001 14:05:58 +0000 (-0000) Subject: Preserve whether or not the line was previously altered when running a X-Git-Tag: 0_60_0~31 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=547e10208224a60c513f3d127ea1d0e2a4e23f19;p=oweals%2Fbusybox.git Preserve whether or not the line was previously altered when running a subst command (discovery and patch by Jim Gleason). --- 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) /* 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; 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) /* 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;