Preserve whether or not the line was previously altered when running a

subst command (discovery and patch by Jim Gleason).
This commit is contained in:
Matt Kraai 2001-07-30 14:05:58 +00:00
parent 7499918f30
commit 547e102082
2 changed files with 4 additions and 4 deletions

View File

@ -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;

4
sed.c
View File

@ -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;