updated feed_char() to reset to the START phase upon an error
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
003ebb1b94
commit
73e3f189a8
15
lib/read.c
15
lib/read.c
@ -2984,7 +2984,7 @@ not_consumed:
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
static int feed_char (hcl_t* hcl, hcl_ooci_t c)
|
static int _feed_char (hcl_t* hcl, hcl_ooci_t c)
|
||||||
{
|
{
|
||||||
/*hcl_logbfmt (hcl, HCL_LOG_STDERR, "FEED->[%jc] %d STATE->%d\n", c, c, FLX_STATE(hcl));*/
|
/*hcl_logbfmt (hcl, HCL_LOG_STDERR, "FEED->[%jc] %d STATE->%d\n", c, c, FLX_STATE(hcl));*/
|
||||||
|
|
||||||
@ -3016,6 +3016,19 @@ static int feed_char (hcl_t* hcl, hcl_ooci_t c)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int feed_char (hcl_t* hcl, hcl_ooci_t c)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
n = _feed_char(hcl, c);
|
||||||
|
if (n <= -1)
|
||||||
|
{
|
||||||
|
/* arrange to read from the start phase next time
|
||||||
|
* in case feeding continues after an error */
|
||||||
|
FEED_CONTINUE (hcl, HCL_FLX_START);
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
static void feed_update_lx_loc (hcl_t* hcl, hcl_ooci_t ch)
|
static void feed_update_lx_loc (hcl_t* hcl, hcl_ooci_t ch)
|
||||||
{
|
{
|
||||||
if (is_linebreak(ch))
|
if (is_linebreak(ch))
|
||||||
|
Loading…
Reference in New Issue
Block a user