#ifndef REGTEST
+#define _PDCLIB_GLUE_H _PDCLIB_GLUE_H
+#include <_PDCLIB_glue.h>
+
char * gets( char * s )
{
- return fgets( s, SIZE_MAX, stdin );
+ if ( _PDCLIB_prepread( stdin ) == EOF )
+ {
+ return NULL;
+ }
+ char * dest = s;
+ while ( ( *dest = stdin->buffer[stdin->bufidx++] ) != '\n' )
+ {
+ if ( stdin->bufidx == stdin->bufend )
+ {
+ if ( _PDCLIB_fillbuffer( stdin ) == EOF )
+ {
+ return NULL;
+ }
+ }
+ ++dest;
+ }
+ *dest = '\n';
+ return s;
}
#endif
}
#endif
+