path: root/meta/recipes-core/busybox/busybox_1.24.1.bb
diff options
authorDengke Du <dengke.du@windriver.com>2016-09-01 00:56:51 -0400
committerDengke Du <dengke.du@windriver.com>2016-09-01 00:56:51 -0400
commitcb48e6f5eecf18d47b9ac45c0b6aec412f79d9ec (patch)
tree0ab1191d32dae7895dd1721c139a14f02859fbec /meta/recipes-core/busybox/busybox_1.24.1.bb
parent2fedd226c3385f1ac160b3aa0bfadbded85e288c (diff)
busybox: fix "sed n (flushes pattern space, terminates early)" testcase failuredengke/busybox-fix-sed-n-testcase-failure
It is a busybox upstream known bug. When the busybox sed sub-command 'n' hit the files EOF, it print an extra character that have been printed, but the GNU sed would not print it. In busybox source code ../editors/sed.c ------------------------------------------------------------------------ case 'n': if (!G.be_quiet) sed_puts(pattern_space, last_gets_char); if (next_line) { free(pattern_space); pattern_space = next_line; last_gets_char = next_gets_char; next_line = get_next_line(&next_gets_char, &last_puts_char, last_gets_char); substituted = 0; linenum++; break; } /* fall through */ /* Quit. End of script, end of input. */ case 'q': /* Exit the outer while loop */ free(next_line); next_line = NULL; goto discard_commands; ------------------------------------------------------------------------ when read at the end of the file, the 'next_line' is null, it would go "case 'q'" and goto discard_commands, the discard_commands would print the old pattern space which have been printed. So in order to comply with GNU sed, in case 'n', when the next_line is null I add "else" at the end of the second "if": "goto again;" and send it to the busybox upstream, the busybox maintainer adopt it and make a little changes to the patch, we can see it at: His reply: http://lists.busybox.net/pipermail/busybox/2016-September/084613.html The new patch on busybox master branch: https://git.busybox.net/busybox/commit/?id=76d72376e0244a5cafd4880cdc623e37d86a75e4 Signed-off-by: Dengke Du <dengke.du@windriver.com>
Diffstat (limited to 'meta/recipes-core/busybox/busybox_1.24.1.bb')
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox_1.24.1.bb b/meta/recipes-core/busybox/busybox_1.24.1.bb
index e8265cd9f5..f370451a3c 100644
--- a/meta/recipes-core/busybox/busybox_1.24.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.24.1.bb
@@ -50,6 +50,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://ip_fix_problem_on_mips64_n64_big_endian_musl_systems.patch \
file://makefile-fix-backport.patch \
file://parallel-make-fix.patch \
+ file://0001-sed-fix-sed-n-flushes-pattern-space-terminates-early.patch \
SRC_URI_append_libc-musl = " file://musl.cfg "