Open
Description
from #1069
58. BUG:
mapfile -t
stops reading the input with an empty line$ bash -c 'mapfile -t lines; declare -p lines' <<< $'hello\n\nworld'
declare -a lines=([0]="hello" [1]="" [2]="world")
$ osh -c 'mapfile -t lines; declare -p lines' <<< $'hello\n\nworld'
declare -a lines=(hello)
Also, it doesn't preserve the initial empty line or the ending newline.$ bash -c 'mapfile -t lines; declare -p lines' <<< $'\nhello'
declare -a lines=([0]="" [1]="hello")
$ bash -c 'mapfile -t lines; declare -p lines' <<< $'hello\n'
declare -a lines=([0]="hello" [1]="")
$ osh -c 'mapfile -t lines; declare -p lines' <<< $'\nhello'
declare -a lines=()
$ osh -c 'mapfile -t lines; declare -p lines' <<< $'hello\n'
declare -a lines=(hello)