[Debconf-devel] Bug#901185: me too
Andreas Metzler
ametzler at bebt.de
Mon Jun 11 19:52:11 BST 2018
On 2018-06-11 Colin Watson <cjwatson at debian.org> wrote:
> On Sun, Jun 10, 2018 at 04:04:13PM +0200, Andreas Metzler wrote:
[...]
> > yes, resetting IFS to its default value in confmodule helps.
> Thanks. For completeness, could you try this variant patch? If shells
> are going to be unreliable about setting IFS in this way, then I'd
> rather just separate out the assignments altogether.
[snip]
Yes, this variant of the patch also works.
Thanks to your handholding we now have a minimal reproducer for the
issue:
----------------------------
(sid)ametzler at argenau:~$ cat /tmp/reproducer.sh
#!/bin/sh
set -e
list="item1 item2"
ls -l /bin/sh
printf "IFS=[%s]" "$IFS" | od -a
IFS='
' read -r dummy
printf "IFS=[%s]" "$IFS" | od -a
for i in $list ; do
echo $i
done
# Error with bash5:
(sid)ametzler at argenau:~$ echo xxx | /tmp/reproducer.sh
lrwxrwxrwx 1 root root 4 Jun 11 18:41 /bin/sh -> bash
0000000 I F S = [ sp ht nl ]
0000011
0000000 I F S = [ nl ]
0000007
item1 item2
#normal behavior with bash4 or dash:
(sid)ametzler at argenau:~$ echo xxx | /tmp/reproducer.sh
lrwxrwxrwx 1 root root 4 Jun 11 18:41 /bin/sh -> bash
0000000 I F S = [ sp ht nl ]
0000011
0000000 I F S = [ sp ht nl ]
0000011
item1
item2
----------------------------
> (This does still seem like a bash bug though, unless there's some arcane
> interpretation of the standards that I'm unaware of.)
Looking at the Open Group Base Specifications Issue 7 I also think this
behavior is a bug, since "read" is not a "a special built-in utility or
function".
cu Andreas
--
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
More information about the Debconf-devel
mailing list