=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/parse/lex.c,v retrieving revision 1.2 retrieving revision 1.5 diff -u -p -r1.2 -r1.5 --- OpenXM_contrib2/asir2018/parse/lex.c 2019/12/13 14:40:50 1.2 +++ OpenXM_contrib2/asir2018/parse/lex.c 2020/10/06 06:45:37 1.5 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2018/parse/lex.c,v 1.1 2018/09/19 05:45:08 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2018/parse/lex.c,v 1.4 2020/10/06 06:31:20 noro Exp $ */ #include #include "ca.h" @@ -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__) || 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]); }