← Commit list

5c69cd84f

Matt Kraai
Matt Kraai
2002-04-01
FAILED Duration: 451s

Subject

* editors/sed.c (process_file): Stop processing deleted lines. * testsuite/sed/sed-does-not-substitute-in-delete-line: New.

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+5 -0
@@ -659,6 +659,7 @@ static void process_file(FILE *file)
/* we are currently within the beginning & ending address range */
still_in_range
) {
+ int deleted = 0;
/*
* actual sedding
@@ -671,6 +672,7 @@ static void process_file(FILE *file)
case 'd':
altered++;
+ deleted = 1;
break;
case 's':
@@ -772,6 +774,9 @@ static void process_file(FILE *file)
else {
still_in_range = 1;
}
+
+ if (deleted)
+ break;
}
}
testsuite/sed/sed-does-not-substitute-in-deleted-line+2 -0
@@ -0,0 +1,2 @@
+echo foo | busybox sed -e /foo/d -e s/foo/bar/ >foo
+cmp foo /dev/null