dx_fn_cmdout_collect_output () {
AS_UNSET([$][1])
# Double up backslashes as they will be stripped by read.
- sed 's/\\/\\\\/g' conftest.do0 >conftest.do1 || return
+ # Heirloom sh read apparently just eats backslashes at EOL, so we compromise
+ # by adding a marker that can be stripped out afterwards.
+ _dx_eol='@%eol@%'
+ sed -e 's/\\/\\\\/g' -e 's/\\$/\\'"$_dx_eol/" conftest.do0 >conftest.do1 ||
+ return
exec 3<conftest.do1
_dx_save_IFS=$IFS
- IFS=
- while read _dx_tmp <&3
+ while IFS=; read _dx_tmp <&3
do
+ IFS=$_dx_save_IFS
+ # strip out EOL marker, if present
+ AS_CASE([$_dx_tmp], [*"\\$_dx_eol"],
+ [_dx_tmp=`AS_ECHO(["$_dx_tmp"]) | sed "s/$_dx_eol\$//"`])
AS_VAR_SET_IF([$][1],
[AS_VAR_APPEND([$][1], ["$as_nl$_dx_tmp"])],
[AS_VAR_SET([$][1], [$_dx_tmp])])