From 39925026f6857979cbe603efd42073eb63f8d9de Mon Sep 17 00:00:00 2001 From: Christian Eggers Date: Mon, 29 Jun 2020 17:57:24 +0200 Subject: shell: Fix "read -d ''" behavior With bash's read builtin it is possible to read from a file (e.g. device-tree) until the first '\0' character: IFS= read -r -d '' VARIABLE < file In busybox ash the -d extension is also implemented, but checking the read character for '\0' has to be performed after comparing with the delimiter. Signed-off-by: Christian Eggers Signed-off-by: Denys Vlasenko --- shell/hush_test/hush-read/read_d0.tests | 1 + 1 file changed, 1 insertion(+) create mode 100755 shell/hush_test/hush-read/read_d0.tests (limited to 'shell/hush_test/hush-read/read_d0.tests') diff --git a/shell/hush_test/hush-read/read_d0.tests b/shell/hush_test/hush-read/read_d0.tests new file mode 100755 index 0000000..630d807 --- /dev/null +++ b/shell/hush_test/hush-read/read_d0.tests @@ -0,0 +1 @@ +printf 'test\0zest\n' | (read -d '' reply; echo "$reply") -- cgit v1.1