fixed the assertion failure that arose when a built-in global variable is set with -v.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
changed multiple open functions to accept hawk_errinfo_t* instead of hawk_errnum_t*
This commit is contained in:
15
bin/cut.c
15
bin/cut.c
@ -368,6 +368,7 @@ int main_cut(int argc, hawk_bch_t* argv[], const hawk_bch_t* real_argv0)
|
||||
hawk_mmgr_t* mmgr = hawk_get_sys_mmgr();
|
||||
hawk_cmgr_t* cmgr = hawk_get_cmgr_by_id(HAWK_CMGR_UTF8);
|
||||
hawk_mmgr_t xma_mmgr;
|
||||
hawk_errinf_t errinf;
|
||||
|
||||
memset (&arg, 0, HAWK_SIZEOF(arg));
|
||||
ret = handle_args(argc, argv, real_argv0, &arg);
|
||||
@ -387,10 +388,20 @@ int main_cut(int argc, hawk_bch_t* argv[], const hawk_bch_t* real_argv0)
|
||||
}
|
||||
|
||||
|
||||
cut = hawk_cut_openstdwithmmgr(mmgr, 0, cmgr, HAWK_NULL);
|
||||
cut = hawk_cut_openstdwithmmgr(mmgr, 0, cmgr, &errinf);
|
||||
if (!cut)
|
||||
{
|
||||
hawk_main_print_error("cannot open stream editor\n");
|
||||
const hawk_bch_t* msg;
|
||||
#if defined(HAWK_OOCH_IS_UCH)
|
||||
hawk_bch_t msgbuf[HAWK_ERRMSG_CAPA];
|
||||
hawk_oow_t msglen, wcslen;
|
||||
msglen = HAWK_COUNTOF(msgbuf);
|
||||
hawk_conv_ucstr_to_bcstr_with_cmgr(errinf.msg, &wcslen, msgbuf, &msglen, cmgr);
|
||||
msg = msgbuf;
|
||||
#else
|
||||
msg = errinf.msg;
|
||||
#endif
|
||||
hawk_main_print_error("cannot open text cutter - %s\n", msg);
|
||||
goto oops;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user