fixed a bug of not setting the last character properly upon EOF in get_char() of awk and xli
This commit is contained in:
parent
caf3cf8171
commit
15300bfcfc
@ -471,10 +471,11 @@ static int get_char (qse_awk_t* awk)
|
|||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
{
|
{
|
||||||
awk->sio.last.c = QSE_CHAR_EOF;
|
awk->sio.inp->last.c = QSE_CHAR_EOF;
|
||||||
awk->sio.last.line = awk->sio.inp->line;
|
awk->sio.inp->last.line = awk->sio.inp->line;
|
||||||
awk->sio.last.colm = awk->sio.inp->colm;
|
awk->sio.inp->last.colm = awk->sio.inp->colm;
|
||||||
awk->sio.last.file = awk->sio.inp->name;
|
awk->sio.inp->last.file = awk->sio.inp->name;
|
||||||
|
awk->sio.last = awk->sio.inp->last;
|
||||||
return 0;
|
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.line = awk->sio.inp->line;
|
||||||
awk->sio.inp->last.colm = awk->sio.inp->colm++;
|
awk->sio.inp->last.colm = awk->sio.inp->colm++;
|
||||||
awk->sio.inp->last.file = awk->sio.inp->name;
|
awk->sio.inp->last.file = awk->sio.inp->name;
|
||||||
|
|
||||||
awk->sio.last = awk->sio.inp->last;
|
awk->sio.last = awk->sio.inp->last;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -122,10 +122,11 @@ static int get_char (qse_xli_t* xli)
|
|||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
{
|
{
|
||||||
xli->sio.last.c = QSE_CHAR_EOF;
|
xli->sio.inp->last.c = QSE_CHAR_EOF;
|
||||||
xli->sio.last.line = xli->sio.inp->line;
|
xli->sio.inp->last.line = xli->sio.inp->line;
|
||||||
xli->sio.last.colm = xli->sio.inp->colm;
|
xli->sio.inp->last.colm = xli->sio.inp->colm;
|
||||||
xli->sio.last.file = xli->sio.inp->name;
|
xli->sio.inp->last.file = xli->sio.inp->name;
|
||||||
|
xli->sio.last = xli->sio.inp->last;
|
||||||
return 0;
|
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.line = xli->sio.inp->line;
|
||||||
xli->sio.inp->last.colm = xli->sio.inp->colm++;
|
xli->sio.inp->last.colm = xli->sio.inp->colm++;
|
||||||
xli->sio.inp->last.file = xli->sio.inp->name;
|
xli->sio.inp->last.file = xli->sio.inp->name;
|
||||||
|
|
||||||
xli->sio.last = xli->sio.inp->last;
|
xli->sio.last = xli->sio.inp->last;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user