some work done for the feed based reader

This commit is contained in:
2022-07-22 08:02:14 +00:00
parent 7f268293f0
commit 65aacaaf4f
5 changed files with 488 additions and 288 deletions

View File

@ -821,11 +821,14 @@ static int feed_loop (hcl_t* hcl, xtn_t* xtn, int cflags, int verbose)
return -1;
}
/*(setvbuf (fp, NULL, _IONBF, 0);*/
while (1)
{
hcl_oow_t n;
n = fread(&buf[len], 1, HCL_COUNTOF(buf) - len, fp);
/*n = fread(&buf[len], 1, HCL_COUNTOF(buf) - len, fp);*/
n = read(fileno(fp), &buf[len], HCL_COUNTOF(buf) - len);
if (n > 0)
{
int x;
@ -861,7 +864,7 @@ static int feed_loop (hcl_t* hcl, xtn_t* xtn, int cflags, int verbose)
}
}
if (feof(fp))
if (n == 0 || feof(fp))
{
if (len > 0)
{