← Commit list

edc388cf4

Glenn L McGrath
Glenn L McGrath
2003-09-14
FAILED Duration: 87s

Subject

The previous fix for 's/a/1/;s/b/2/;t one;p;:one;p' broke the case of echo fooba | ./busybox sed -n 's/foo//;s/bar/found/p'

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/sed.c+2 -3
@@ -915,8 +915,7 @@ static void process_file(FILE * file)
}
}
#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;
}
@@ -1105,7 +1104,7 @@ static void process_file(FILE * file)
/* 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);