From ff6f895c314e140d7e5527db4be7eaf59565b7e6 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 31 Dec 2021 06:31:57 +0000 Subject: [PATCH] minor update of an error message --- bin/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/main.c b/bin/main.c index b900953..40e84e4 100644 --- a/bin/main.c +++ b/bin/main.c @@ -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,7 +309,10 @@ static HCL_INLINE int open_output (hcl_t* hcl, hcl_iooutarg_t* arg) #endif if (!fp) { - hcl_seterrnum (hcl, HCL_EIOERR); + if (xtn->print_path) + hcl_seterrbfmt (hcl, HCL_EIOERR, "unable to open %hs", xtn->print_path); + else + hcl_seterrnum (hcl, HCL_EIOERR); return -1; }