fixed a bug of not handling console output properly in
qse_awk_rtx_opensimple()
This commit is contained in:
@ -41,6 +41,7 @@ int main ()
|
||||
qse_awk_t* awk = QSE_NULL;
|
||||
qse_awk_rtx_t* rtx = QSE_NULL;
|
||||
int ret;
|
||||
const qse_char_t* co[] = { QSE_T(""), QSE_NULL };
|
||||
|
||||
awk = qse_awk_opensimple ();
|
||||
if (awk == QSE_NULL)
|
||||
@ -51,7 +52,7 @@ int main ()
|
||||
|
||||
ret = qse_awk_parsesimple (
|
||||
awk,
|
||||
QSE_AWK_PARSE_STRING, src, /* parse AWK source in a string */
|
||||
QSE_AWK_SOURCE_STRING, src, /* parse AWK source in a string */
|
||||
QSE_NULL /* no parse output */
|
||||
);
|
||||
if (ret == -1)
|
||||
@ -63,7 +64,8 @@ int main ()
|
||||
|
||||
rtx = qse_awk_rtx_opensimple (
|
||||
awk,
|
||||
QSE_NULL /* no console files */
|
||||
QSE_NULL, /* no console input */
|
||||
QSE_AWK_CONSOLE_STDIO /* use standard out for console output */
|
||||
);
|
||||
if (rtx == QSE_NULL)
|
||||
{
|
||||
|
@ -61,9 +61,11 @@ int main ()
|
||||
qse_awk_setoption (awk, qse_awk_getoption(awk) & ~QSE_AWK_PABLOCK);
|
||||
|
||||
ret = qse_awk_parsesimple (
|
||||
awk,
|
||||
QSE_AWK_PARSE_STRING, src, /* parse AWK source in a string */
|
||||
QSE_NULL /* no parse output */
|
||||
awk,
|
||||
/* parse AWK source in a string */
|
||||
QSE_AWK_SOURCE_STRING, src,
|
||||
/* no parse output */
|
||||
QSE_NULL
|
||||
);
|
||||
if (ret == -1)
|
||||
{
|
||||
@ -75,7 +77,8 @@ int main ()
|
||||
/* create a runtime context */
|
||||
rtx = qse_awk_rtx_opensimple (
|
||||
awk,
|
||||
QSE_NULL /* no console files */
|
||||
QSE_NULL, /* no console input */
|
||||
QSE_AWK_CONSOLE_STDIO /* console output */
|
||||
);
|
||||
if (rtx == QSE_NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user