<commit_before>/* $Id$ */

/* gets( char * )

   This file is part of the Public Domain C Library (PDCLib).
   Permission is granted to use, modify, and / or redistribute at will.
*/

#include <stdio.h>

#ifndef REGTEST
#include <_PDCLIB_io.h>
#include <stdint.h>

char * gets( char * s )
{
    if ( _PDCLIB_prepread( stdin ) == EOF )
    {
        return NULL;
    }
    char * dest = s;
    
    dest += _PDCLIB_getchars( dest, SIZE_MAX, '\n', stdin );

    if(*(dest - 1) == '\n') {
        *(--dest) = '\0';
    } else {
        *dest = '\0';<commit_msg>gets: lock file before performing read<commit_after>/* $Id$ */

/* gets( char * )

   This file is part of the Public Domain C Library (PDCLib).
   Permission is granted to use, modify, and / or redistribute at will.
*/

#include <stdio.h>

#ifndef REGTEST
#include <_PDCLIB_io.h>
#include <stdint.h>

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';
    } else {
        *dest = '\0';
{'fraction_non_alphanumeric': 0.15903614457831325, 'fraction_numerical': 0.004819277108433735, 'mean_word_length': 2.3050397877984086, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5411195', 'n_tokens_mistral': 477, 'n_tokens_neox': 462, 'n_words': 132}