fixed a bug of not setting the last character properly upon EOF in get_char() of awk and xli

This commit is contained in:
hyung-hwan 2013-05-15 15:08:39 +00:00
parent caf3cf8171
commit 15300bfcfc
2 changed files with 10 additions and 10 deletions

View File

@ -471,10 +471,11 @@ static int get_char (qse_awk_t* awk)
if (n == 0)
{
awk->sio.last.c = QSE_CHAR_EOF;
awk->sio.last.line = awk->sio.inp->line;
awk->sio.last.colm = awk->sio.inp->colm;
awk->sio.last.file = awk->sio.inp->name;
awk->sio.inp->last.c = QSE_CHAR_EOF;
awk->sio.inp->last.line = awk->sio.inp->line;
awk->sio.inp->last.colm = awk->sio.inp->colm;
awk->sio.inp->last.file = awk->sio.inp->name;
awk->sio.last = awk->sio.inp->last;
return 0;
}
@ -497,7 +498,6 @@ static int get_char (qse_awk_t* awk)
awk->sio.inp->last.line = awk->sio.inp->line;
awk->sio.inp->last.colm = awk->sio.inp->colm++;
awk->sio.inp->last.file = awk->sio.inp->name;
awk->sio.last = awk->sio.inp->last;
return 0;
}

View File

@ -122,10 +122,11 @@ static int get_char (qse_xli_t* xli)
if (n == 0)
{
xli->sio.last.c = QSE_CHAR_EOF;
xli->sio.last.line = xli->sio.inp->line;
xli->sio.last.colm = xli->sio.inp->colm;
xli->sio.last.file = xli->sio.inp->name;
xli->sio.inp->last.c = QSE_CHAR_EOF;
xli->sio.inp->last.line = xli->sio.inp->line;
xli->sio.inp->last.colm = xli->sio.inp->colm;
xli->sio.inp->last.file = xli->sio.inp->name;
xli->sio.last = xli->sio.inp->last;
return 0;
}
@ -148,7 +149,6 @@ static int get_char (qse_xli_t* xli)
xli->sio.inp->last.line = xli->sio.inp->line;
xli->sio.inp->last.colm = xli->sio.inp->colm++;
xli->sio.inp->last.file = xli->sio.inp->name;
xli->sio.last = xli->sio.inp->last;
return 0;
}