-/* $Id$ */
-
/* gets( char * )
This file is part of the Public Domain C Library (PDCLib).
char * gets( char * s )
{
+ _PDCLIB_flockfile( stdin );
if ( _PDCLIB_prepread( stdin ) == EOF )
{
+ _PDCLIB_funlockfile( stdin );
return NULL;
}
char * dest = s;
dest += _PDCLIB_getchars( dest, SIZE_MAX, '\n', stdin );
+ _PDCLIB_funlockfile( stdin );
if(*(dest - 1) == '\n') {
*(--dest) = '\0';
int main( void )
{
+#ifndef REGTEST
FILE * fh;
char buffer[10];
char const * gets_test = "foo\nbar\0baz\nweenie";
TESTCASE( gets( buffer ) == NULL );
TESTCASE( fclose( fh ) == 0 );
TESTCASE( remove( testfile ) == 0 );
+#endif
return TEST_RESULTS;
}