compacted code a bit
This commit is contained in:
		@ -886,6 +886,7 @@ static int fnc_openlog (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
 | 
			
		||||
	qse_awk_val_t* retv;
 | 
			
		||||
	qse_char_t* ident = QSE_NULL;
 | 
			
		||||
	qse_size_t ident_len;
 | 
			
		||||
	qse_mchar_t* mbs_ident;
 | 
			
		||||
	mod_ctx_t* mctx = fi->mod->ctx;
 | 
			
		||||
 | 
			
		||||
#if defined(ENABLE_SYSLOG)
 | 
			
		||||
@ -900,31 +901,16 @@ static int fnc_openlog (qse_awk_rtx_t* rtx, const qse_awk_fnc_info_t* fi)
 | 
			
		||||
	if (qse_awk_rtx_valtoint(rtx, qse_awk_rtx_getarg(rtx, 2), &fac) <= -1) goto done;
 | 
			
		||||
 | 
			
		||||
#if defined(QSE_CHAR_IS_MCHAR)
 | 
			
		||||
	{
 | 
			
		||||
		qse_mchar_t* mbs;
 | 
			
		||||
 | 
			
		||||
		mbs = qse_mbsdup(ident, qse_awk_rtx_getmmgr(rtx));
 | 
			
		||||
		if (!mbs) goto done;
 | 
			
		||||
 | 
			
		||||
		if (mctx->log_ident) qse_awk_rtx_freemem (rtx, mctx->log_ident);
 | 
			
		||||
		mctx->log_ident = mbs;
 | 
			
		||||
 | 
			
		||||
		openlog(mbs, opt, fac);
 | 
			
		||||
	}
 | 
			
		||||
	mbs_ident = qse_mbsdup(ident, qse_awk_rtx_getmmgr(rtx));
 | 
			
		||||
#else
 | 
			
		||||
	{
 | 
			
		||||
 | 
			
		||||
		qse_mchar_t* mbs;
 | 
			
		||||
		mbs = qse_wcstombsdup(ident, QSE_NULL, qse_awk_rtx_getmmgr(rtx));
 | 
			
		||||
		if (!mbs) goto done;
 | 
			
		||||
	mbs_ident = qse_wcstombsdup(ident, QSE_NULL, qse_awk_rtx_getmmgr(rtx));
 | 
			
		||||
#endif
 | 
			
		||||
	if (!mbs_ident) goto done;
 | 
			
		||||
 | 
			
		||||
	if (mctx->log_ident) qse_awk_rtx_freemem (rtx, mctx->log_ident);
 | 
			
		||||
		mctx->log_ident = mbs;
 | 
			
		||||
 | 
			
		||||
		openlog (mbs, opt, fac);
 | 
			
		||||
	}
 | 
			
		||||
	#endif
 | 
			
		||||
	mctx->log_ident = mbs_ident;
 | 
			
		||||
 | 
			
		||||
	openlog(mbs_ident, opt, fac);
 | 
			
		||||
	rx = 0;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user