<commit_before>#include <stdio.h>
#include <stdlib.h>

/******************************************************************************
 Copyright 2013, <NAME>
 This library is licensed under 3 clause BSD license.
 If it's not shipped with this software, find it yourself.
 *****************************************************************************/

size_t grepline(char **lineptr, size_t *n, FILE * stream)
{
	size_t len = 0;
	size_t last = 0;
	char trash = 0;
	char * buf = NULL;
	if(lineptr != NULL)
	{
		free(*lineptr);
	}
	do
	{
/* CRLF? Into the trash it goes */
		trash = fgetc(stream);
		if(trash != '\r')
		{
			last = len;
			++len;
#ifdef CXX11
			buf = (char *)realloc(buf,len);
#else
			buf = realloc(buf,len);
#endif /*CXX11*/
<<<<<<< HEAD
			buf[last] = trash;
		}
=======
		buf[last] = (char)fgetc(stream);
>>>>>>> dda65466b9a965bf65057a107bf7546ba5f9b8e8
	}
	while(!feof(stream) && trash != '\n');
	if(buf[last] == EOF)
	{
		buf[last] = '\n';
	}
/* We'll now null-terminate the string! */
#ifdef CXX11
	buf = (char *)realloc(buf,len+1);
#else
	buf = realloc(buf,len+1);
#endif /*CXX11*/
	buf[len] = '\0';
/* Plugging our input pointers up the addresses we were using */
	*n = len;
	*lineptr = buf;
	return len;
}<commit_msg>grepline WILL NOT count CR<commit_after>#include <stdio.h>
#include <stdlib.h>

/******************************************************************************
 Copyright 2013, <NAME>
 This library is licensed under 3 clause BSD license.
 If it's not shipped with this software, find it yourself.
 *****************************************************************************/

size_t grepline(char **lineptr, size_t *n, FILE * stream)
{
	size_t len = 0;
	size_t last = 0;
	char trash = 0;
	char * buf = NULL;
	if(lineptr != NULL)
	{
		free(*lineptr);
	}
	do
	{
/* CRLF? Into the trash it goes */
		trash = fgetc(stream);
		if(trash != '\r')
		{
			last = len;
			++len;
#ifdef CXX11
			buf = (char *)realloc(buf,len);
#else
			buf = realloc(buf,len);
#endif /*CXX11*/
			buf[last] = trash;
		}
	}
	while(!feof(stream) && trash != '\n');
	if(buf[last] == EOF)
	{
		buf[last] = '\n';
	}
/* We'll now null-terminate the string! */
#ifdef CXX11
	buf = (char *)realloc(buf,len+1);
#else
	buf = realloc(buf,len+1);
#endif /*CXX11*/
	buf[len] = '\0';
/* Plugging our input pointers up the addresses we were using */
	*n = len;
	*lineptr = buf;
	return len;
}
{'fraction_non_alphanumeric': 0.28589315525876463, 'fraction_numerical': 0.026293823038397328, 'mean_word_length': 4.110874200426439, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '1482939', 'n_tokens_mistral': 962, 'n_tokens_neox': 857, 'n_words': 236}