← Commit list

977451ef4

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

Subject

Fix a simple mistake with pattern space, and add a test for it

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 -2
@@ -1070,9 +1070,9 @@ static void process_file(FILE * file)
}
pattern_space = xrealloc(pattern_space, pattern_space_size + hold_space_size);
if (pattern_space_size == 2) {
- strcat(pattern_space, "\n");
- } else {
strcpy(pattern_space, "\n");
+ } else {
+ strcat(pattern_space, "\n");
}
if (hold_space) {
strcat(pattern_space, hold_space);
testsuite/sed/sed-append-hold-space-to-pattern-space+13 -0
@@ -0,0 +1,13 @@
+busybox sed 'G'>output <<EOF
+a
+b
+c
+EOF
+cmp -s output - <<EOF
+a
+
+b
+
+c
+
+EOF