<commit_before>#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>

#include "fs.h"

const char DIRSEP = '/';

/* cat must be of size PATH_MAX + 1. */
void concat(const char *d, const char *f, char cat[])
{
	unsigned int dl = strlen(d);
	while (dl > 0 && d[dl - 1] == DIRSEP)
		dl -= 1;
	unsigned int fl = strlen(f);
	while (fl > 0 && f[0] == DIRSEP) {
		f += 1;<commit_msg>Hack: forward declare readdir_r since clang can't find it.<commit_after>#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>

#include "fs.h"

const char DIRSEP = '/';

/* clang can't seem to find this on Ubuntu 10.10. */
extern int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);

/* cat must be of size PATH_MAX + 1. */
void concat(const char *d, const char *f, char cat[])
{
	unsigned int dl = strlen(d);
	while (dl > 0 && d[dl - 1] == DIRSEP)
		dl -= 1;
	unsigned int fl = strlen(f);
	while (fl > 0 && f[0] == DIRSEP) {
		f += 1;
{'fraction_non_alphanumeric': 0.1820469798657718, 'fraction_numerical': 0.015100671140939598, 'mean_word_length': 3.734126984126984, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, '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': '297449', 'n_tokens_mistral': 520, 'n_tokens_neox': 485, 'n_words': 150}