fixed a bug in hcl_feed()

This commit is contained in:
hyung-hwan 2022-07-18 10:39:10 +00:00
parent 173e2e1a06
commit 7a81c58ae3

View File

@ -2952,9 +2952,10 @@ int hcl_feed (hcl_t* hcl, const hcl_ooch_t* data, hcl_oow_t len)
{ {
x = feed_char(hcl, data[i]); x = feed_char(hcl, data[i]);
if (x <= -1) return -1; if (x <= -1) return -1;
i += x;
if (x > 0) if (x > 0)
{ {
/* consumed */
if (is_linebreak(data[i])) if (is_linebreak(data[i]))
{ {
hcl->c->feed.lx.loc.line++; hcl->c->feed.lx.loc.line++;
@ -2964,7 +2965,9 @@ int hcl_feed (hcl_t* hcl, const hcl_ooch_t* data, hcl_oow_t len)
{ {
hcl->c->feed.lx.loc.colm++; hcl->c->feed.lx.loc.colm++;
} }
i += x;
} }
/* feed again if not consumed */
} }
} }
else else