made a small fix over file inclusion failure handling
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
hyung-hwan 2024-04-21 14:44:03 +09:00
parent 803f9b2817
commit ccbaae98a4

View File

@ -1089,9 +1089,7 @@ static int feed_begin_include (hcl_t* hcl)
hcl_io_cciarg_t* arg; hcl_io_cciarg_t* arg;
const hcl_ooch_t* io_name; const hcl_ooch_t* io_name;
/*hcl_logbfmt(hcl, HCL_LOG_STDERR, "adding... %js\n", TOKEN_NAME_PTR(hcl));*/
io_name = add_sr_name(hcl, TOKEN_NAME(hcl)); io_name = add_sr_name(hcl, TOKEN_NAME(hcl));
/*hcl_logbfmt(hcl, HCL_LOG_STDERR, "added... %js\n", io_name);*/
if (HCL_UNLIKELY(!io_name)) if (HCL_UNLIKELY(!io_name))
{ {
const hcl_ooch_t* orgmsg = hcl_backuperrmsg(hcl); const hcl_ooch_t* orgmsg = hcl_backuperrmsg(hcl);
@ -3279,8 +3277,8 @@ int hcl_feed (hcl_t* hcl, const hcl_ooch_t* data, hcl_oow_t len)
if (hcl->c->feed.rd.do_include_file) if (hcl->c->feed.rd.do_include_file)
{ {
hcl->c->feed.rd.do_include_file = 0; /* done regardless of inclusion result */
if (feed_begin_include(hcl) <= -1) goto oops; if (feed_begin_include(hcl) <= -1) goto oops;
hcl->c->feed.rd.do_include_file = 0;
} }
if (hcl->c->curinp && hcl->c->curinp != &hcl->c->cci_arg && feed_from_includee(hcl) <= -1) if (hcl->c->curinp && hcl->c->curinp != &hcl->c->cci_arg && feed_from_includee(hcl) <= -1)