=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/parse/lex.c,v retrieving revision 1.1 retrieving revision 1.6 diff -u -p -r1.1 -r1.6 --- OpenXM_contrib2/asir2018/parse/lex.c 2018/09/19 05:45:08 1.1 +++ OpenXM_contrib2/asir2018/parse/lex.c 2022/09/07 03:17:44 1.6 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM$ + * $OpenXM: OpenXM_contrib2/asir2018/parse/lex.c,v 1.5 2020/10/06 06:45:37 noro Exp $ */ #include #include "ca.h" @@ -60,7 +60,7 @@ #include "y.tab.h" #endif #if FEP -#include +#include #endif static int Getc(); @@ -455,15 +455,23 @@ int yylex() } } else return ( c ); + /* XXX */ + return 0; } +/* for __fpurge() */ +#if defined(linux) +#include +#endif + void purge_stdin() { -#if defined(__FreeBSD__) || defined(__DARWIN__) +#if defined(__FreeBSD__) || defined(__DARWIN__) || defined(ANDROID) fpurge(stdin); #elif defined(linux) - stdin->_IO_read_end = stdin->_IO_read_base; - stdin->_IO_read_ptr = stdin->_IO_read_base; +// stdin->_IO_read_end = stdin->_IO_read_base; +// stdin->_IO_read_ptr = stdin->_IO_read_base; + __fpurge(stdin); #elif defined(VISUAL_LIB) void w_purge_stdin(); @@ -519,12 +527,13 @@ int afternl() { quote = quote ? 0 : 1; else if ( quote && (*ptr == ' ') ) *ptr = '_'; - stoarg(buf0,&ac,av); - if ( ac == 3 ) + stoarg(buf0,&ac,av); + if ( ac == 3 ) { if ( (i = atoi(av[2])) == 1 ) ilevel++; else if ( i == 2 ) ilevel--; + } if ( !ilevel ) asir_infile->ln = atoi(av[0]); }