echo fooba | ./busybox sed -n 's/foo//;s/bar/found/p'
I really need to start adding these tests to the testsuite.
keep the substituted and altered flags seperate
}
}
#endif
- altered = substituted;
- if (!be_quiet && altered && ((sed_cmd->next == NULL)
+ if (!be_quiet && substituted && ((sed_cmd->next == NULL)
|| (sed_cmd->next->cmd != 's'))) {
force_print = 1;
}
/* we will print the line unless we were told to be quiet or if the
* line was altered (via a 'd'elete or 's'ubstitution), in which case
* the altered line was already printed */
- if ((!be_quiet && !altered) || force_print) {
+ if ((!be_quiet && !altered && !substituted) || force_print) {
puts(pattern_space);
}
free(pattern_space);