← Commit list

2eed0e2d4

Glenn L McGrath
Glenn L McGrath
2003-09-15
FAILED Duration: 68s

Subject

Add a test for the 'P' command and fix current implementation so it doesnt permanently modify the pattern space.

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+4 -0
@@ -857,7 +857,11 @@ static void process_file(FILE * file)
if (tmp) {
*tmp = '\0';
+ puts(pattern_space);
+ *tmp = '\n';
+ break;
}
+ /* Fall Through */
}
case 'p': /* Write the current pattern space to output */
puts(pattern_space);
testsuite/sed/sed-write-to-stdout+10 -0
@@ -0,0 +1,10 @@
+busybox sed -n 'N;P;p'>output <<EOF
+a
+b
+c
+EOF
+cmp -s output - <<EOF
+a
+a
+b
+EOF