In the function zwrite, in the file builtins/evalstring.c, in the
case of a partial write the pointer `buf' is not updated and the
next write will re-write the initial contents of buf.
I believe a fix is to insert the line marked with /* XXX */ below.
--art
static int
zwrite (fd, buf, nb)
int fd;
unsigned char *buf;
int nb;
{
int n, i, nt;
for (n = nb, nt = 0;;)
{
i = write (fd, buf, n);
if (i > 0)
{
n -= i;
if (n <= 0)
return nb;
buf += i; /* XXX */
}
else if (i == 0)
{
if (++nt > 3)
return (nb - n);
}
else if (errno != EINTR)
return -1;
}
}