made getbline implementation more sensible but still not good enough

This commit is contained in:
2020-01-17 03:41:10 +00:00
parent 0c2a13b652
commit 102a773bed
3 changed files with 44 additions and 28 deletions

View File

@@ -6809,8 +6809,6 @@ read_console_again:
}
else if (n > 0)
{
#if 0
/* the implementation is not perfect yet. */
if (p->in_type == HAWK_IN_CONSOLE)
{
HAWK_ASSERT (p->in == HAWK_NULL);
@@ -6826,14 +6824,15 @@ read_console_again:
}
}
}
#endif
if (p->var == HAWK_NULL)
{
/* set $0 with the input value */
/*x = hawk_rtx_setbrec(rtx, 0, HAWK_BECS_BCS(buf));
if (x <= -1) return HAWK_NULL;*/
/* TODO: can i support this? */
hawk_rtx_seterrbfmt(rtx, &nde->loc, HAWK_ENOIMPL, "getbline without a variable not supported");
hawk_rtx_seterrfmt(rtx, &nde->loc, HAWK_ENOIMPL, HAWK_T("getbline without a variable not supported"));
return HAWK_NULL;
}
else
{
@@ -6852,14 +6851,12 @@ read_console_again:
if (tmp == HAWK_NULL) return HAWK_NULL;
}
#if 0
/* update FNR & NR if reading from console */
if (p->in_type == HAWK_IN_CONSOLE &&
update_fnr(rtx, rtx->gbl.fnr + 1, rtx->gbl.nr + 1) <= -1)
{
return HAWK_NULL;
}
#endif
}
skip_read: