[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
minor bug in bash 2.03 (zwrite)
From: |
Art Medlar |
Subject: |
minor bug in bash 2.03 (zwrite) |
Date: |
Mon, 30 Oct 2000 12:54:43 -0800 (PST) |
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;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- minor bug in bash 2.03 (zwrite),
Art Medlar <=
- Prev by Date:
F.R,E;E .C,A.BL;E,... ;B,U.I;LD. ,Y;OU.R, ;OW,N. ;Ll;EG;AL. ,C;AB.L,E; .D,E;SC.R,A.M;BL,E.R..................... 8839
- Next by Date:
Parameter expansion/assignment broken in cat
- Previous by thread:
F.R,E;E .C,A.BL;E,... ;B,U.I;LD. ,Y;OU.R, ;OW,N. ;Ll;EG;AL. ,C;AB.L,E; .D,E;SC.R,A.M;BL,E.R..................... 8839
- Next by thread:
Parameter expansion/assignment broken in cat
- Index(es):