corrected swapped code between qse_awk_rtx_findfunwithmbs() and qse_awk_rtx_findfunwithwcs()

This commit is contained in:
hyung-hwan 2019-08-29 09:09:37 +00:00
parent 74ff72564e
commit 9f889d8243
2 changed files with 11 additions and 11 deletions

View File

@ -320,7 +320,7 @@ const qse_mchar_t* qse_awk_rtx_geterrmsgasmbs (qse_awk_rtx_t* rtx)
qse_size_t wcslen, mbslen;
msg = (rtx->errinf.msg[0] == QSE_T('\0')) ?
qse_awk_geterrstr(rtx->awk)(rtx->awk,rtx->errinf.num): rtx->errinf.msg;
qse_awk_geterrstr(rtx->awk)(rtx->awk, rtx->errinf.num): rtx->errinf.msg;
mbslen = QSE_COUNTOF(rtx->merrmsg);
qse_wcstombswithcmgr(msg, &wcslen, rtx->merrmsg, &mbslen, qse_awk_rtx_getcmgr(rtx));

View File

@ -1533,12 +1533,12 @@ qse_awk_fun_t* qse_awk_rtx_findfunwithmbs (qse_awk_rtx_t* rtx, const qse_mchar_t
#if defined(QSE_CHAR_IS_MCHAR)
return find_fun(rtx, name);
#else
qse_mcstr_t mbs;
qse_wcstr_t wcs;
qse_awk_fun_t* fun;
mbs.ptr = qse_awk_rtx_wcstombsdup(rtx, name, &mbs.len);
if (!mbs.ptr) return -1;
fun = find_fun(rtx, mbs.ptr);
qse_awk_rtx_freemem (rtx, mbs.ptr);
wcs.ptr = qse_awk_rtx_mbstowcsdup(rtx, name, &wcs.len);
if (!wcs.ptr) return QSE_NULL;
fun = find_fun(rtx, wcs.ptr);
qse_awk_rtx_freemem (rtx, wcs.ptr);
return fun;
#endif
}
@ -1546,12 +1546,12 @@ qse_awk_fun_t* qse_awk_rtx_findfunwithmbs (qse_awk_rtx_t* rtx, const qse_mchar_t
qse_awk_fun_t* qse_awk_rtx_findfunwithwcs (qse_awk_rtx_t* rtx, const qse_wchar_t* name)
{
#if defined(QSE_CHAR_IS_MCHAR)
qse_wcstr_t wcs;
qse_mcstr_t mbs;
qse_awk_fun_t* fun;
wcs.ptr = qse_awk_rtx_mbstowcsdup(rtx, name, &wcs.len);
if (!wcs.ptr) return -1;
fun = find_fun(rtx, wcs.ptr);
qse_awk_rtx_freemem (rtx, wcs.ptr);
mbs.ptr = qse_awk_rtx_wcstombsdup(rtx, name, &mbs.len);
if (!mbs.ptr) return QSE_NULL;
fun = find_fun(rtx, mbs.ptr);
qse_awk_rtx_freemem (rtx, mbs.ptr);
return fun;
#else
return find_fun(rtx, name);