minor update of an error message

This commit is contained in:
hyung-hwan 2021-12-31 06:31:57 +00:00
parent 72724799b3
commit ff6f895c31

View File

@ -131,7 +131,7 @@ static HCL_INLINE int open_input (hcl_t* hcl, hcl_ioinarg_t* arg)
fn = ((bb_t*)arg->includer->handle)->fn;
fb = get_base_name (fn);
fb = get_base_name(fn);
parlen = fb - fn;
bb = (bb_t*)hcl_callocmem (hcl, HCL_SIZEOF(*bb) + (HCL_SIZEOF(hcl_bch_t) * (parlen + bcslen + 1)));
@ -166,7 +166,7 @@ static HCL_INLINE int open_input (hcl_t* hcl, hcl_ioinarg_t* arg)
#endif
if (!bb->fp)
{
hcl_seterrnum (hcl, HCL_EIOERR);
hcl_seterrbfmt (hcl, HCL_EIOERR, "unable to open %hs", bb->fn);
goto oops;
}
@ -309,6 +309,9 @@ static HCL_INLINE int open_output (hcl_t* hcl, hcl_iooutarg_t* arg)
#endif
if (!fp)
{
if (xtn->print_path)
hcl_seterrbfmt (hcl, HCL_EIOERR, "unable to open %hs", xtn->print_path);
else
hcl_seterrnum (hcl, HCL_EIOERR);
return -1;
}