busybox/shell/ash_test
Ron Yorston dcd8df258a shell: improve bash compatibility of read built-in
Make the read built-in more compatible with bash:

- Return an exit code of 142 on timeout.

- When the timeout expires before a newline is detected in the
  input bash captures the partial input.  This behaviour is new
  since bash version 4.4.  BusyBox shells had the pre-4.4 behaviour
  where the input was lost.

Update the tests to suit and fix a couple of compiler errors in
the testsuite.

function                                             old     new   delta
builtin_read                                         154     174     +20
readcmd                                              213     228     +15
shell_builtin_read                                  1364    1370      +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 41/0)               Total: 41 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-07-01 20:21:37 +02:00
..
ash-alias ash: parser: Fix alias expansion after heredoc or newlines 2021-09-08 01:43:12 +02:00
ash-arith shell/math: bash-compatible handling of too large numbers 2023-06-25 17:42:05 +02:00
ash-comm shell: fix script's comm field if ENABLE_FEATURE_PREFER_APPLETS=y 2021-10-11 18:44:00 +02:00
ash-getopts hush: fix "getopts" builtin to not be upset by other builtins calling getopt() 2017-08-29 13:38:30 +02:00
ash-glob ash: expand: Do not quote backslashes in unquoted parameter expansion 2018-08-07 18:58:02 +02:00
ash-heredoc ash: fix ifs cleanup on error paths 2022-08-02 11:18:11 +02:00
ash-invert add ash testcases 2007-03-05 20:46:46 +00:00
ash-misc hush: fix ELIF cmd1;cmd2 THEN ... not executing cmd2, closes 15571 2023-05-25 14:22:10 +02:00
ash-parsing hush: detect when terminating "done"/"fi" is missing 2024-02-25 17:53:25 +01:00
ash-psubst ash: LINENO starts from 0 in -c SCRIPT mode 2021-09-07 18:16:45 +02:00
ash-quoting ash: fix handling of single-quoted strings in pattern substitution 2024-02-26 16:27:53 +01:00
ash-read shell: improve bash compatibility of read built-in 2025-07-01 20:21:37 +02:00
ash-redir hush: do not exit interactive shell on some redirection errors 2024-07-13 02:13:28 +02:00
ash-signals ash: improve trap and jobs builtins in child shells 2023-03-31 14:22:56 +02:00
ash-standalone ash: fix nofork bug where environment is not properly passed to a command 2017-11-03 14:16:25 +01:00
ash-vars ash: don't read past end of var in subvareval for bash substitutions 2022-03-01 08:47:43 +01:00
ash-z_slow hush: improve ${var#...}, ${var:+...} and ${var/.../...} - handle quoting 2018-07-17 14:21:38 +02:00
.gitignore ash_test: ignore generated files 2016-03-22 18:15:24 -04:00
printenv.c shell: improve bash compatibility of read built-in 2025-07-01 20:21:37 +02:00
recho.c shell: improve bash compatibility of read built-in 2025-07-01 20:21:37 +02:00
run-all shell: sync ash/hush test scripts 2023-06-14 15:19:02 +02:00
zecho.c whitespace cleanup 2010-10-29 11:46:52 +02:00